From 3464736d8572d912b0a3a30166d7615523059da8 Mon Sep 17 00:00:00 2001 From: Supositware Date: Sun, 28 Jan 2024 21:55:19 +0100 Subject: [PATCH] Fix anything triggering boolean options in commands --- events/client/messageCreate.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/events/client/messageCreate.js b/events/client/messageCreate.js index d6e5e7b..5d041e6 100644 --- a/events/client/messageCreate.js +++ b/events/client/messageCreate.js @@ -411,13 +411,16 @@ export default { payload = messageArgs.slice(i).join(' '); } - if (messageArgs[i].startsWith('--')) { + if (arg.type === ApplicationCommandOptionType.Boolean && !messageArgs[i].startsWith('--')) { + continue; + } + else if (messageArgs[i].startsWith('--')) { payloadName = payload.substring(2); payload = true; j--; } - if (arg.type === ApplicationCommandOptionType.Mentionable) { + if (arg.type === ApplicationCommandOptionType.Mentionable || arg.type === ApplicationCommandOptionType.User) { await message.guild.members.fetch(); payload = message.mentions.members.first() ? message.mentions.members.first() : message.guild.members.cache.find(u => u.user.username.toLowerCase().includes(payload.toLowerCase())); }