diff --git a/src/client/actions/GuildDelete.js b/src/client/actions/GuildDelete.js index a6a98d57a..3edd6fbe2 100644 --- a/src/client/actions/GuildDelete.js +++ b/src/client/actions/GuildDelete.js @@ -15,7 +15,7 @@ class GuildDeleteAction extends Action { let guild = client.guilds.cache.get(data.id); if (guild) { for (const channel of guild.channels.cache.values()) { - if (channel.type in TextBasedChannelTypes) channel.stopTyping(true); + if (TextBasedChannelTypes.includes(channel.type)) channel.stopTyping(true); } if (data.unavailable) { diff --git a/src/client/actions/MessageReactionAdd.js b/src/client/actions/MessageReactionAdd.js index a3638ce30..452ed6b12 100644 --- a/src/client/actions/MessageReactionAdd.js +++ b/src/client/actions/MessageReactionAdd.js @@ -23,7 +23,7 @@ class MessageReactionAdd extends Action { // Verify channel const channel = this.getChannel(data); - if (!channel || channel.type in VoiceBasedChannelTypes) return false; + if (!channel || VoiceBasedChannelTypes.includes(channel.type)) return false; // Verify message const message = this.getMessage(data, channel); diff --git a/src/client/actions/MessageReactionRemove.js b/src/client/actions/MessageReactionRemove.js index c21c2cc5c..8b66899e2 100644 --- a/src/client/actions/MessageReactionRemove.js +++ b/src/client/actions/MessageReactionRemove.js @@ -20,7 +20,7 @@ class MessageReactionRemove extends Action { // Verify channel const channel = this.getChannel(data); - if (!channel || channel.type in VoiceBasedChannelTypes) return false; + if (!channel || VoiceBasedChannelTypes.includes(channel.type)) return false; // Verify message const message = this.getMessage(data, channel); diff --git a/src/client/actions/MessageReactionRemoveAll.js b/src/client/actions/MessageReactionRemoveAll.js index 70ab720a2..404ef9453 100644 --- a/src/client/actions/MessageReactionRemoveAll.js +++ b/src/client/actions/MessageReactionRemoveAll.js @@ -7,7 +7,7 @@ class MessageReactionRemoveAll extends Action { handle(data) { // Verify channel const channel = this.getChannel(data); - if (!channel || channel.type in VoiceBasedChannelTypes) return false; + if (!channel || VoiceBasedChannelTypes.includes(channel.type)) return false; // Verify message const message = this.getMessage(data, channel); diff --git a/src/client/actions/MessageReactionRemoveEmoji.js b/src/client/actions/MessageReactionRemoveEmoji.js index fff47611d..8a8a71e23 100644 --- a/src/client/actions/MessageReactionRemoveEmoji.js +++ b/src/client/actions/MessageReactionRemoveEmoji.js @@ -6,7 +6,7 @@ const { Events, VoiceBasedChannelTypes } = require('../../util/Constants'); class MessageReactionRemoveEmoji extends Action { handle(data) { const channel = this.getChannel(data); - if (!channel || channel.type in VoiceBasedChannelTypes) return false; + if (!channel || VoiceBasedChannelTypes.includes(channel.type)) return false; const message = this.getMessage(data, channel); if (!message) return false; diff --git a/src/client/actions/TypingStart.js b/src/client/actions/TypingStart.js index 6e6495cf5..ba1c58704 100644 --- a/src/client/actions/TypingStart.js +++ b/src/client/actions/TypingStart.js @@ -9,7 +9,7 @@ class TypingStart extends Action { if (!channel) { return; } - if (!(channel.type in TextBasedChannelTypes)) { + if (!TextBasedChannelTypes.includes(channel.type)) { this.client.emit(Events.WARN, `Discord sent a typing packet to a ${channel.type} channel ${channel.id}`); return; } diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index 24616ec21..d5150393e 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -573,7 +573,7 @@ class GuildChannel extends Channel { */ get manageable() { if (this.client.user.id === this.guild.ownerId) return true; - if (this.type in VoiceBasedChannelTypes) { + if (VoiceBasedChannelTypes.includes(this.type)) { if (!this.permissionsFor(this.client.user).has(Permissions.FLAGS.CONNECT, false)) { return false; }