Oversight, missed /send in refactoring...
| @@ -511,7 +511,7 @@ export function initDefaultSlashCommands() { | ||
| 511 | 511 | SlashCommandParser.addCommandObject(SlashCommand.fromProps({ |
| 512 | 512 | name: 'send', |
| 513 | 513 | callback: sendUserMessageCallback, |
| 514 | 514 | returns: 'TheOptionally the text of the sent message, if specified in the "return" argument', |
| 515 | 515 | namedArgumentList: [ |
| 516 | 516 | new SlashCommandNamedArgument( |
| 517 | 517 | 'compact', |
| @@ -534,6 +534,14 @@ export function initDefaultSlashCommands() { | ||
| 534 | 534 | defaultValue: '{{user}}', |
| 535 | 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 | 546 | unnamedArgumentList: [ |
| 539 | 547 | new SlashCommandArgument( |
| @@ -2923,7 +2931,7 @@ async function sendUserMessageCallback(args, text) { | ||
| 2923 | 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 | 2937 | async function deleteMessagesByNameCallback(_, name) { |