Add {{newline}} and {{pipe}} macros

This commit is contained in:
Cohee
2023-11-23 22:56:52 +02:00
parent 86819b6f4f
commit 3594c4aac7
3 changed files with 9 additions and 1 deletions

View File

@ -1014,7 +1014,12 @@ async function executeSlashCommands(text) {
}
console.debug('Slash command executing:', result);
const unnamedArg = result.value || pipeResult;
let unnamedArg = result.value || pipeResult;
if (typeof unnamedArg === 'string' && /{{pipe}}/i.test(unnamedArg)) {
unnamedArg = unnamedArg.replace(/{{pipe}}/i, pipeResult);
}
pipeResult = await result.command.callback(result.args, unnamedArg);
if (result.command.interruptsGeneration) {