From 1eb3b8a01398f38af72746fc256692d27d0b2992 Mon Sep 17 00:00:00 2001 From: Supositware Date: Mon, 12 Sep 2022 11:36:51 +0200 Subject: [PATCH] Actually fix command flags? --- events/client/messageCreate.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/events/client/messageCreate.js b/events/client/messageCreate.js index b091a87b..65a347e7 100644 --- a/events/client/messageCreate.js +++ b/events/client/messageCreate.js @@ -375,16 +375,17 @@ export default { const arg = command.data.options[i]; const type = arg.constructor.name.toLowerCase(); let payload = messageArgs[i]; - if (type.includes('mentionable')) { + + if (payload.startsWith('--')) { + arg.name = payload.substring(2); + payload = true; + } + else if (type.includes('mentionable')) { payload = message.mentions.members.first(); } else if (type.includes('attachment')) { payload = message.attachments.first(); } - else if (payload.startsWith('--')) { - arg.name = payload.substring(2); - payload = true; - } args[arg.name] = payload; }