mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-12 01:50:11 +01:00
Update return values of send commands
- /sendas - /sys - /comment
This commit is contained in:
parent
5952c35402
commit
0ab74f0819
@ -176,6 +176,7 @@ export function initDefaultSlashCommands() {
|
|||||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
||||||
name: 'sendas',
|
name: 'sendas',
|
||||||
callback: sendMessageAs,
|
callback: sendMessageAs,
|
||||||
|
returns: 'The text of the sent message',
|
||||||
namedArgumentList: [
|
namedArgumentList: [
|
||||||
SlashCommandNamedArgument.fromProps({
|
SlashCommandNamedArgument.fromProps({
|
||||||
name: 'name',
|
name: 'name',
|
||||||
@ -222,6 +223,7 @@ export function initDefaultSlashCommands() {
|
|||||||
name: 'sys',
|
name: 'sys',
|
||||||
callback: sendNarratorMessage,
|
callback: sendNarratorMessage,
|
||||||
aliases: ['nar'],
|
aliases: ['nar'],
|
||||||
|
returns: 'The text of the sent message',
|
||||||
namedArgumentList: [
|
namedArgumentList: [
|
||||||
new SlashCommandNamedArgument(
|
new SlashCommandNamedArgument(
|
||||||
'compact',
|
'compact',
|
||||||
@ -276,6 +278,7 @@ export function initDefaultSlashCommands() {
|
|||||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
||||||
name: 'comment',
|
name: 'comment',
|
||||||
callback: sendCommentMessage,
|
callback: sendCommentMessage,
|
||||||
|
returns: 'The text of the sent message',
|
||||||
namedArgumentList: [
|
namedArgumentList: [
|
||||||
new SlashCommandNamedArgument(
|
new SlashCommandNamedArgument(
|
||||||
'compact',
|
'compact',
|
||||||
@ -2843,7 +2846,7 @@ function findPersonaByName(name) {
|
|||||||
|
|
||||||
async function sendUserMessageCallback(args, text) {
|
async function sendUserMessageCallback(args, text) {
|
||||||
if (!text) {
|
if (!text) {
|
||||||
console.warn('WARN: No text provided for /send command');
|
toastr.warning('You must specify text to send');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3205,11 +3208,12 @@ export async function sendMessageAs(args, text) {
|
|||||||
await saveChatConditional();
|
await saveChatConditional();
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return message.mes;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function sendNarratorMessage(args, text) {
|
export async function sendNarratorMessage(args, text) {
|
||||||
if (!text) {
|
if (!text) {
|
||||||
|
toastr.warning('You must specify text to send');
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3258,7 +3262,7 @@ export async function sendNarratorMessage(args, text) {
|
|||||||
await saveChatConditional();
|
await saveChatConditional();
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return message.mes;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function promptQuietForLoudResponse(who, text) {
|
export async function promptQuietForLoudResponse(who, text) {
|
||||||
@ -3304,6 +3308,7 @@ export async function promptQuietForLoudResponse(who, text) {
|
|||||||
|
|
||||||
async function sendCommentMessage(args, text) {
|
async function sendCommentMessage(args, text) {
|
||||||
if (!text) {
|
if (!text) {
|
||||||
|
toastr.warning('You must specify text to send');
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3346,7 +3351,7 @@ async function sendCommentMessage(args, text) {
|
|||||||
await saveChatConditional();
|
await saveChatConditional();
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return message.mes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user