fix typehints for while unnamed arg / command

This commit is contained in:
LenAnderson
2024-05-19 06:24:32 -04:00
parent 963e525e07
commit 89de668241

View File

@ -316,14 +316,21 @@ function listVariablesCallback() {
sendSystemMessage(system_message_types.GENERIC, htmlMessage); sendSystemMessage(system_message_types.GENERIC, htmlMessage);
} }
async function whileCallback(args, command) { /**
*
* @param {import('./slash-commands/SlashCommand.js').NamedArguments} args
* @param {(string|SlashCommandClosure)[]} value
*/
async function whileCallback(args, value) {
const isGuardOff = isFalseBoolean(args.guard); const isGuardOff = isFalseBoolean(args.guard);
const iterations = isGuardOff ? Number.MAX_SAFE_INTEGER : MAX_LOOPS; const iterations = isGuardOff ? Number.MAX_SAFE_INTEGER : MAX_LOOPS;
if (command) { /**@type {string|SlashCommandClosure} */
if (command[0] instanceof SlashCommandClosure) { let command;
command = command[0]; if (value) {
if (value[0] instanceof SlashCommandClosure) {
command = value[0];
} else { } else {
command = command.join(' '); command = value.join(' ');
} }
} }