Fix anything triggering boolean options in commands

This commit is contained in:
Supositware 2024-01-28 21:55:19 +01:00
parent fd7ca30e1c
commit 3464736d85

View file

@ -411,13 +411,16 @@ export default {
payload = messageArgs.slice(i).join(' '); 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); payloadName = payload.substring(2);
payload = true; payload = true;
j--; j--;
} }
if (arg.type === ApplicationCommandOptionType.Mentionable) { if (arg.type === ApplicationCommandOptionType.Mentionable || arg.type === ApplicationCommandOptionType.User) {
await message.guild.members.fetch(); 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())); payload = message.mentions.members.first() ? message.mentions.members.first() : message.guild.members.cache.find(u => u.user.username.toLowerCase().includes(payload.toLowerCase()));
} }