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

e45e89ce16dc6dfd91989eeb7b06d88ad9ba87c1

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +6 -1Ignore whitespace
public/scripts/slash-commands.js+6 -1
@@ -2847,7 +2847,6 @@ export async function sendMessageAs(args, text) {
28472847
28482848 if (args.name) {
28492849 name = args.name.trim();
2850- mesText = text.trim();
28512850
28522851 if (!name && !text) {
28532852 toastr.warning('You must specify a name and text to send as');
@@ -2860,8 +2859,14 @@ export async function sendMessageAs(args, text) {
28602859 localStorage.setItem(namelessWarningKey, 'true');
28612860 }
28622861 name = name2;
2862+ if (!text) {
2863+ toastr.warning('You must specify text to send as');
2864+ return '';
2865+ }
28632866 }
28642867
2868+ mesText = text.trim();
2869+
28652870 // Requires a regex check after the slash command is pushed to output
28662871 mesText = getRegexedString(mesText, regex_placement.SLASH_COMMAND, { characterOverride: name });
28672872