FIX: Properly handle text responses when character name is not provided in sendas cmd

211c671cb6586d6bde25256324f33d7aa1b59d18

joenunezb <joenunezb@gmail.com>

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