Fix pattern checking on /replace

5ddc8f17a0958e5bd8bc42475955047ed729dd2b

Crow <bismuthglass@protonmail.com>

1 files changed, +2 -1Ignore whitespace
public/scripts/slash-commands.js+2 -1
@@ -2079,8 +2079,9 @@ export function initDefaultSlashCommands() {
2079 name: 'replace',2079 name: 'replace',
2080 aliases: ['re'],2080 aliases: ['re'],
2081 callback: (async ({ mode = 'literal', pattern, replacer = '' }, text) => {2081 callback: (async ({ mode = 'literal', pattern, replacer = '' }, text) => {
2082 if (pattern === '')2082 if (!pattern) {
2083 throw new Error('Argument of \'pattern=\' cannot be empty');2083 throw new Error('Argument of \'pattern=\' cannot be empty');
2084 }
2084 switch (mode) {2085 switch (mode) {
2085 case 'literal':2086 case 'literal':
2086 return text.replaceAll(pattern, replacer);2087 return text.replaceAll(pattern, replacer);