Inject supports variables for ID

This commit is contained in:
Cohee 2024-06-23 17:21:55 +03:00
parent 2012bb49d2
commit 6594b3c7fa

View File

@ -1251,9 +1251,17 @@ SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'inject',
callback: injectCallback,
namedArgumentList: [
new SlashCommandNamedArgument(
'id', 'injection ID', [ARGUMENT_TYPE.STRING], true,
),
SlashCommandNamedArgument.fromProps({
name: 'id',
description: 'injection ID or variable name pointing to ID',
typeList: [ARGUMENT_TYPE.STRING, ARGUMENT_TYPE.VARIABLE_NAME],
isRequired: true,
enumProvider: () => [
...commonEnumProviders.injects(),
...commonEnumProviders.variables('all')().map(x => { x.description = 'Variable'; return x; }),
],
}),
new SlashCommandNamedArgument(
'position', 'injection position', [ARGUMENT_TYPE.STRING], false, false, 'after', ['before', 'after', 'chat'],
),