mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-11 17:07:07 +01:00
Oversight, missed /send in refactoring...
This commit is contained in:
parent
7a1b43eb89
commit
f317b1b764
@ -511,7 +511,7 @@ export function initDefaultSlashCommands() {
|
|||||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
||||||
name: 'send',
|
name: 'send',
|
||||||
callback: sendUserMessageCallback,
|
callback: sendUserMessageCallback,
|
||||||
returns: 'The text of the sent message',
|
returns: 'Optionally the text of the sent message, if specified in the "return" argument',
|
||||||
namedArgumentList: [
|
namedArgumentList: [
|
||||||
new SlashCommandNamedArgument(
|
new SlashCommandNamedArgument(
|
||||||
'compact',
|
'compact',
|
||||||
@ -534,6 +534,14 @@ export function initDefaultSlashCommands() {
|
|||||||
defaultValue: '{{user}}',
|
defaultValue: '{{user}}',
|
||||||
enumProvider: commonEnumProviders.personas,
|
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: [
|
unnamedArgumentList: [
|
||||||
new SlashCommandArgument(
|
new SlashCommandArgument(
|
||||||
@ -2923,7 +2931,7 @@ async function sendUserMessageCallback(args, text) {
|
|||||||
message = await sendMessageAsUser(text, bias, insertAt, compact);
|
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) {
|
async function deleteMessagesByNameCallback(_, name) {
|
||||||
|
Loading…
Reference in New Issue
Block a user