diff --git a/public/scripts/extensions/quick-reply/src/SlashCommandHandler.js b/public/scripts/extensions/quick-reply/src/SlashCommandHandler.js index 015ccf2ba..fe3bcf0e3 100644 --- a/public/scripts/extensions/quick-reply/src/SlashCommandHandler.js +++ b/public/scripts/extensions/quick-reply/src/SlashCommandHandler.js @@ -526,6 +526,34 @@ export class SlashCommandHandler { `, })); + + SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'qr-arg', + callback: ({ _scope }, [key, value]) => { + _scope.setMacro(`arg::${key}`, value, false); + return ''; + }, + unnamedArgumentList: [ + SlashCommandArgument.fromProps({ description: 'argument name', + typeList: ARGUMENT_TYPE.STRING, + isRequired: true, + }), + SlashCommandArgument.fromProps({ description: 'argument value', + typeList: [ARGUMENT_TYPE.STRING, ARGUMENT_TYPE.NUMBER, ARGUMENT_TYPE.BOOLEAN, ARGUMENT_TYPE.LIST, ARGUMENT_TYPE.DICTIONARY], + isRequired: true, + }), + ], + splitUnnamedArgument: true, + splitUnnamedArgumentCount: 2, + helpString: ` +
/qr-arg x foo |\n/echo {{arg::x}}
+