Oversight, missed /send in refactoring...

This commit is contained in:
Wolfsblvt 2024-10-01 00:41:14 +02:00
parent 7a1b43eb89
commit f317b1b764

View File

@ -511,7 +511,7 @@ export function initDefaultSlashCommands() {
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'send',
callback: sendUserMessageCallback,
returns: 'The text of the sent message',
returns: 'Optionally the text of the sent message, if specified in the "return" argument',
namedArgumentList: [
new SlashCommandNamedArgument(
'compact',
@ -534,6 +534,14 @@ export function initDefaultSlashCommands() {
defaultValue: '{{user}}',
enumProvider: commonEnumProviders.personas,
}),
SlashCommandNamedArgument.fromProps({
name: 'return',
description: 'The way how you want the return value to be provided',
typeList: [ARGUMENT_TYPE.STRING],
defaultValue: 'none',
enumList: slashCommandReturnHelper.enumList({ allowObject: true }),
forceEnum: true,
}),
],
unnamedArgumentList: [
new SlashCommandArgument(
@ -2923,7 +2931,7 @@ async function sendUserMessageCallback(args, text) {
message = await sendMessageAsUser(text, bias, insertAt, compact);
}
return message.mes;
return await slashCommandReturnHelper.doReturn(args.return ?? 'none', message, { objectToStringFunc: x => x.mes });
}
async function deleteMessagesByNameCallback(_, name) {