Fix type errors in variables.js
| @@ -321,7 +321,7 @@ async function listVariablesCallback(args) { | |||
| 321 | */ | 321 | */ |
| 322 | async function whileCallback(args, value) { | 322 | async function whileCallback(args, value) { |
| 323 | if (args.guard instanceof SlashCommandClosure) throw new Error('argument \'guard\' cannot be a closure for command /while'); | 323 | if (args.guard instanceof SlashCommandClosure) throw new Error('argument \'guard\' cannot be a closure for command /while'); |
| 324 | const isGuardOff = isFalseBoolean(args.guard); | 324 | const isGuardOff = isFalseBoolean(args.guard?.toString()); |
| 325 | const iterations = isGuardOff ? Number.MAX_SAFE_INTEGER : MAX_LOOPS; | 325 | const iterations = isGuardOff ? Number.MAX_SAFE_INTEGER : MAX_LOOPS; |
| 326 | /**@type {string|SlashCommandClosure} */ | 326 | /**@type {string|SlashCommandClosure} */ |
| 327 | let command; | 327 | let command; |
| @@ -380,7 +380,7 @@ async function timesCallback(args, value) { | |||
| 380 | [repeats, ...command] = /**@type {string}*/(value).split(' '); | 380 | [repeats, ...command] = /**@type {string}*/(value).split(' '); |
| 381 | command = command.join(' '); | 381 | command = command.join(' '); |
| 382 | } | 382 | } |
| 383 | const isGuardOff = isFalseBoolean(args.guard); | 383 | const isGuardOff = isFalseBoolean(args.guard?.toString()); |
| 384 | const iterations = Math.min(Number(repeats), isGuardOff ? Number.MAX_SAFE_INTEGER : MAX_LOOPS); | 384 | const iterations = Math.min(Number(repeats), isGuardOff ? Number.MAX_SAFE_INTEGER : MAX_LOOPS); |
| 385 | let result; | 385 | let result; |
| 386 | for (let i = 0; i < iterations; i++) { | 386 | for (let i = 0; i < iterations; i++) { |