From 3bc91f10ec389a95855aeb9c25563baa3d22e638 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 26 Nov 2023 15:47:11 +0200 Subject: [PATCH] Fix command aliases --- public/scripts/slash-commands.js | 8 ++++---- public/scripts/variables.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/scripts/slash-commands.js b/public/scripts/slash-commands.js index 6139122b0..e9396e6e8 100644 --- a/public/scripts/slash-commands.js +++ b/public/scripts/slash-commands.js @@ -170,14 +170,14 @@ parser.addCommand('genraw', generateRawCallback, [], '(l parser.addCommand('addswipe', addSwipeCallback, ['swipeadd'], '(text) – adds a swipe to the last chat message.', true, true); parser.addCommand('abort', abortCallback, [], ' – aborts the slash command batch execution', true, true); parser.addCommand('fuzzy', fuzzyCallback, [], 'list=["a","b","c"] (search value) – performs a fuzzy match of the provided search using the provided list of value and passes the closest match to the next command through the pipe.', true, true); -parser.addCommand('pass', (_, arg) => arg, [], '(text) – passes the text to the next command through the pipe.', true, true); +parser.addCommand('pass', (_, arg) => arg, ['return'], '(text) – passes the text to the next command through the pipe.', true, true); parser.addCommand('delay', delayCallback, ['wait', 'sleep'], '(milliseconds) – delays the next command in the pipe by the specified number of milliseconds.', true, true); parser.addCommand('input', inputCallback, ['prompt'], '(prompt) – shows a popup with the provided prompt and passes the user input to the next command through the pipe.', true, true); parser.addCommand('run', runCallback, ['call', 'exec'], '(QR label) – runs a Quick Reply with the specified name from the current preset.', true, true); parser.addCommand('messages', getMessagesCallback, ['message'], '(names=off/on [message index or range]) – returns the specified message or range of messages as a string.', true, true); parser.addCommand('setinput', setInputCallback, [], '(text) – sets the user input to the specified text and passes it to the next command through the pipe.', true, true); parser.addCommand('popup', popupCallback, [], '(text) – shows a blocking popup with the specified text.', true, true); -parser.addCommand('trimtokens', trimTokensCallback, [], '(direction=start/end limit=number [text]) – trims the start or end of text to the specified number of tokens.', true, true); +parser.addCommand('trimtokens', trimTokensCallback, [], 'limit=number (direction=start/end [text]) – trims the start or end of text to the specified number of tokens.', true, true); parser.addCommand('trimstart', trimStartCallback, [], '(text) – trims the text to the start of the first full sentence.', true, true); parser.addCommand('trimend', trimEndCallback, [], '(text) – trims the text to the end of the last full sentence.', true, true); registerVariableCommands(); @@ -258,7 +258,7 @@ function trimTokensCallback(arg, value) { async function popupCallback(_, value) { const safeValue = DOMPurify.sanitize(value || ''); await delay(1); - await callPopup(safeValue, 'text'); + await callPopup(safeValue, 'text', ''); await delay(1); return value; } @@ -338,7 +338,7 @@ async function inputCallback(_, prompt) { // Do not remove this delay, otherwise the prompt will not show up await delay(1); const safeValue = DOMPurify.sanitize(prompt || ''); - const result = await callPopup(safeValue, 'input'); + const result = await callPopup(safeValue, 'input', '', { okButton: 'Ok' }); await delay(1); return result || ''; } diff --git a/public/scripts/variables.js b/public/scripts/variables.js index 27eef66fc..b2b6ed0fd 100644 --- a/public/scripts/variables.js +++ b/public/scripts/variables.js @@ -341,7 +341,7 @@ function deleteGlobalVariable(name) { } export function registerVariableCommands() { - registerSlashCommand('listvar', listVariablesCallback, [''], ' – list registered chat variables', true, true); + registerSlashCommand('listvar', listVariablesCallback, [], ' – list registered chat variables', true, true); registerSlashCommand('setvar', (args, value) => setLocalVariable(args.key || args.name, value), [], 'key=varname (value) – set a local variable value and pass it down the pipe, e.g. /setvar key=color green', true, true); registerSlashCommand('getvar', (_, value) => getLocalVariable(value), [], '(key) – get a local variable value and pass it down the pipe, e.g. /getvar height', true, true); registerSlashCommand('addvar', (args, value) => addLocalVariable(args.key || args.name, value), [], 'key=varname (increment) – add a value to a local variable and pass the result down the pipe, e.g. /addvar score 10', true, true);