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', name: 'inject',
callback: injectCallback, callback: injectCallback,
namedArgumentList: [ namedArgumentList: [
new SlashCommandNamedArgument( SlashCommandNamedArgument.fromProps({
'id', 'injection ID', [ARGUMENT_TYPE.STRING], true, 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( new SlashCommandNamedArgument(
'position', 'injection position', [ARGUMENT_TYPE.STRING], false, false, 'after', ['before', 'after', 'chat'], 'position', 'injection position', [ARGUMENT_TYPE.STRING], false, false, 'after', ['before', 'after', 'chat'],
), ),