From e8004b5b56c20b4395c478e58aaf34ce91d266c3 Mon Sep 17 00:00:00 2001 From: ceruleandeep Date: Fri, 29 Nov 2024 11:52:57 +1100 Subject: [PATCH] Wire up id= parameter for /qr-context* Parameter is in the named arguments but was not handled in the handler. Added `args.id !== undefined ? Number(args.id) : args.label` etc, as used elsewhere. --- .../quick-reply/src/SlashCommandHandler.js | 43 ++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/public/scripts/extensions/quick-reply/src/SlashCommandHandler.js b/public/scripts/extensions/quick-reply/src/SlashCommandHandler.js index f6b339cdf..15f7524a4 100644 --- a/public/scripts/extensions/quick-reply/src/SlashCommandHandler.js +++ b/public/scripts/extensions/quick-reply/src/SlashCommandHandler.js @@ -419,30 +419,35 @@ export class SlashCommandHandler { namedArgumentList: [ SlashCommandNamedArgument.fromProps({ name: 'set', - description: 'QR set name', + description: 'Name of QR set to add the context menu to', typeList: [ARGUMENT_TYPE.STRING], isRequired: true, enumProvider: localEnumProviders.qrSets, }), SlashCommandNamedArgument.fromProps({ name: 'label', - description: 'Quick Reply label', + description: 'Label of Quick Reply to add the context menu to', typeList: [ARGUMENT_TYPE.STRING], enumProvider: localEnumProviders.qrEntries, }), SlashCommandNamedArgument.fromProps({ name: 'id', - description: 'numeric ID of the QR, e.g., id=42', + description: 'Numeric ID of Quick Reply to add the context menu to, e.g. id=42', typeList: [ARGUMENT_TYPE.NUMBER], enumProvider: localEnumProviders.qrIds, }), new SlashCommandNamedArgument( - 'chain', 'boolean', [ARGUMENT_TYPE.BOOLEAN], false, false, 'false', + 'chain', + 'If true, button QR is sent together with (before) the clicked QR from the context menu', + [ARGUMENT_TYPE.BOOLEAN], + false, + false, + 'false', ), ], unnamedArgumentList: [ SlashCommandArgument.fromProps({ - description: 'QR set name', + description: 'Name of QR set to add as a context menu', typeList: [ARGUMENT_TYPE.STRING], isRequired: true, enumProvider: localEnumProviders.qrSets, @@ -450,13 +455,16 @@ export class SlashCommandHandler { ], helpString: `
- Add context menu preset to a QR. + Add a context menu preset to a QR. +
+
+ If id and label are both provided, id will be used.
Example:
@@ -470,27 +478,27 @@ export class SlashCommandHandler { namedArgumentList: [ SlashCommandNamedArgument.fromProps({ name: 'set', - description: 'QR set name', + description: 'Name of QR set to remove the context menu from', typeList: [ARGUMENT_TYPE.STRING], isRequired: true, enumProvider: localEnumProviders.qrSets, }), SlashCommandNamedArgument.fromProps({ name: 'label', - description: 'Quick Reply label', + description: 'Label of Quick Reply to remove the context menu from', typeList: [ARGUMENT_TYPE.STRING], enumProvider: localEnumProviders.qrEntries, }), SlashCommandNamedArgument.fromProps({ name: 'id', - description: 'numeric ID of the QR, e.g., id=42', + description: 'Numeric ID of Quick Reply to remove the context menu from, e.g. id=42', typeList: [ARGUMENT_TYPE.NUMBER], enumProvider: localEnumProviders.qrIds, }), ], unnamedArgumentList: [ SlashCommandArgument.fromProps({ - description: 'QR set name', + description: 'Name of QR set to remove', typeList: [ARGUMENT_TYPE.STRING], isRequired: true, enumProvider: localEnumProviders.qrSets, @@ -500,6 +508,9 @@ export class SlashCommandHandler {
Remove context menu preset from a QR.
+
+ If id and label are both provided, id will be used. +
Example: