unescape args before calling callback

This commit is contained in:
LenAnderson 2024-01-26 18:58:44 +00:00
parent 4d534e3042
commit 2cdf928fc7
2 changed files with 14 additions and 1 deletions

View File

@ -1565,6 +1565,19 @@ async function executeSlashCommands(text, unescape = false) {
unnamedArg = unnamedArg.replace(/{{pipe}}/i, pipeResult ?? '');
}
unnamedArg = unnamedArg
?.replace(/\\\|/g, '|')
?.replace(/\\\{/g, '{')
?.replace(/\\\}/g, '}')
;
for (const [key, value] of Object.entries(result.args)) {
result.args[key] = value
.replace(/\\\|/g, '|')
.replace(/\\\{/g, '{')
.replace(/\\\}/g, '}')
;
}
pipeResult = await result.command.callback(result.args, unnamedArg);
if (result.command.interruptsGeneration) {

View File

@ -492,7 +492,7 @@ async function executeSubCommands(command) {
command = command.slice(0, -1);
}
const unescape = true;
const unescape = false;
const result = await executeSlashCommands(command, unescape);
if (!result || typeof result !== 'object') {