unescape args before calling callback
This commit is contained in:
parent
4d534e3042
commit
2cdf928fc7
|
@ -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) {
|
||||
|
|
|
@ -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') {
|
||||
|
|
Loading…
Reference in New Issue