From 7c39b62d2c5e51828c2d8b92d1fb372cb4f34ee6 Mon Sep 17 00:00:00 2001 From: Supositware Date: Sat, 10 Sep 2022 09:36:07 +0200 Subject: [PATCH] Fix the boolean/flags args --- events/client/messageCreate.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/events/client/messageCreate.js b/events/client/messageCreate.js index 020107d..4c21008 100644 --- a/events/client/messageCreate.js +++ b/events/client/messageCreate.js @@ -381,13 +381,10 @@ export default { else if (type.includes('attachment')) { payload = message.attachments.first(); } - else if (type.includes('boolean')) { - if (messageArgs[i].toLowerCase() === `--${arg.name.toLowerCase()}`) { - payload = true; - } - else { - payload = false; - } + + if (payload.startsWith('--')) { + arg.name = payload.substring(2); + payload = true; } args[arg.name] = payload;