mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-12 17:36:22 +01:00
Deprecate old /sendas syntax.
"name" arg is now required, but defaults to {{char}} for compatibility
This commit is contained in:
parent
49074effce
commit
e08a21ebe7
@ -20,6 +20,7 @@ import {
|
|||||||
is_send_press,
|
is_send_press,
|
||||||
main_api,
|
main_api,
|
||||||
name1,
|
name1,
|
||||||
|
name2,
|
||||||
reloadCurrentChat,
|
reloadCurrentChat,
|
||||||
removeMacros,
|
removeMacros,
|
||||||
retriggerFirstMessageOnEmptyChat,
|
retriggerFirstMessageOnEmptyChat,
|
||||||
@ -1404,14 +1405,12 @@ export async function sendMessageAs(args, text) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const parts = text.split('\n');
|
const namelessWarningKey = 'sendAsNamelessWarningShown';
|
||||||
if (parts.length <= 1) {
|
if (localStorage.getItem(namelessWarningKey) !== 'true') {
|
||||||
toastr.warning('Both character name and message are required. Separate them with a new line.');
|
toastr.warning('To avoid confusion, please use /sendas name="Character Name"', 'Name defaulted to {{char}}', { timeOut: 10000 });
|
||||||
return;
|
localStorage.setItem(namelessWarningKey, 'true');
|
||||||
}
|
}
|
||||||
|
name = name2;
|
||||||
name = parts.shift().trim();
|
|
||||||
mesText = parts.join('\n').trim();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Requires a regex check after the slash command is pushed to output
|
// Requires a regex check after the slash command is pushed to output
|
||||||
|
Loading…
Reference in New Issue
Block a user