Oversight, missed /send in refactoring...
| @@ -511,7 +511,7 @@ export function initDefaultSlashCommands() { | |||
| 511 | SlashCommandParser.addCommandObject(SlashCommand.fromProps({ | 511 | SlashCommandParser.addCommandObject(SlashCommand.fromProps({ |
| 512 | name: 'send', | 512 | name: 'send', |
| 513 | callback: sendUserMessageCallback, | 513 | callback: sendUserMessageCallback, |
| 514 | returns: 'The text of the sent message', | 514 | returns: 'Optionally the text of the sent message, if specified in the "return" argument', |
| 515 | namedArgumentList: [ | 515 | namedArgumentList: [ |
| 516 | new SlashCommandNamedArgument( | 516 | new SlashCommandNamedArgument( |
| 517 | 'compact', | 517 | 'compact', |
| @@ -534,6 +534,14 @@ export function initDefaultSlashCommands() { | |||
| 534 | defaultValue: '{{user}}', | 534 | defaultValue: '{{user}}', |
| 535 | enumProvider: commonEnumProviders.personas, | 535 | enumProvider: commonEnumProviders.personas, |
| 536 | }), | 536 | }), |
| 537 | SlashCommandNamedArgument.fromProps({ | ||
| 538 | name: 'return', | ||
| 539 | description: 'The way how you want the return value to be provided', | ||
| 540 | typeList: [ARGUMENT_TYPE.STRING], | ||
| 541 | defaultValue: 'none', | ||
| 542 | enumList: slashCommandReturnHelper.enumList({ allowObject: true }), | ||
| 543 | forceEnum: true, | ||
| 544 | }), | ||
| 537 | ], | 545 | ], |
| 538 | unnamedArgumentList: [ | 546 | unnamedArgumentList: [ |
| 539 | new SlashCommandArgument( | 547 | new SlashCommandArgument( |
| @@ -2923,7 +2931,7 @@ async function sendUserMessageCallback(args, text) { | |||
| 2923 | message = await sendMessageAsUser(text, bias, insertAt, compact); | 2931 | message = await sendMessageAsUser(text, bias, insertAt, compact); |
| 2924 | } | 2932 | } |
| 2925 | 2933 | ||
| 2926 | return message.mes; | 2934 | return await slashCommandReturnHelper.doReturn(args.return ?? 'none', message, { objectToStringFunc: x => x.mes }); |
| 2927 | } | 2935 | } |
| 2928 | 2936 | ||
| 2929 | async function deleteMessagesByNameCallback(_, name) { | 2937 | async function deleteMessagesByNameCallback(_, name) { |