diff --git a/src/commandclient.ts b/src/commandclient.ts index 6c3a2b8..c9b1fb2 100644 --- a/src/commandclient.ts +++ b/src/commandclient.ts @@ -30,7 +30,7 @@ export class CommandClient extends Client { this.on('messageCreate', async (msg: Message) => { if (!msg.content.startsWith(config.prefix) || msg.author.bot) return; - if (msg.author.id != config.owner && (await BlacklistUsers.findOne({ where: { user_id: msg.author.id } }))) return; + if (!config.owners.includes(msg.author.id) && (await BlacklistUsers.findOne({ where: { user_id: msg.author.id } }))) return; this.parseCommand(msg); }); @@ -52,7 +52,7 @@ export class CommandClient extends Client { return; } - if (command.permission && int.user.id != config.owner) { + if (command.permission && !config.owners.includes(int.user.id)) { if (!(int.channel instanceof GuildChannel)) { int.reply({ content: strings.command.guildOnly, ephemeral: true }); return; @@ -117,7 +117,7 @@ export class CommandClient extends Client { return; }; - if (command.ownerOnly && msg.author.id != config.owner) { + if (command.ownerOnly && !config.owners.includes(msg.author.id)) { msg.reply(strings.command.ownerOnly); return; } @@ -125,7 +125,7 @@ export class CommandClient extends Client { if (msg.channel instanceof GuildChannel) { if (!msg.member) throw new Error('Command sending member does not exist'); - if (msg.author.id != config.owner) { + if (!config.owners.includes(msg.author.id)) { if (command.permission) { for (const permission of command.permission) { if (!msg.member.permissionsIn(msg.channel).has(permission)) { @@ -169,7 +169,7 @@ export class CommandClient extends Client { return; } - if (command.cooldown && msg.author.id != config.owner) { + if (command.cooldown && !config.owners.includes(msg.author.id)) { if (!this.cooldowns.has(command.name)) { this.cooldowns.set(command.name, new Collection()); }