mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-02 10:57:45 +01:00
Merge pull request #2577 from joenunezb/fix-handle-text-response-from-sendas
Fix: Properly handle text responses when character name is not provided in sendas cmd
This commit is contained in:
commit
e45e89ce16
@ -2847,7 +2847,6 @@ export async function sendMessageAs(args, text) {
|
||||
|
||||
if (args.name) {
|
||||
name = args.name.trim();
|
||||
mesText = text.trim();
|
||||
|
||||
if (!name && !text) {
|
||||
toastr.warning('You must specify a name and text to send as');
|
||||
@ -2860,8 +2859,14 @@ export async function sendMessageAs(args, text) {
|
||||
localStorage.setItem(namelessWarningKey, 'true');
|
||||
}
|
||||
name = name2;
|
||||
if (!text) {
|
||||
toastr.warning('You must specify text to send as');
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
mesText = text.trim();
|
||||
|
||||
// Requires a regex check after the slash command is pushed to output
|
||||
mesText = getRegexedString(mesText, regex_placement.SLASH_COMMAND, { characterOverride: name });
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user