Only check permissions on current channel

This commit is contained in:
TheEssem 2021-03-12 14:42:07 -06:00
parent b9a6b9e615
commit f2e81b7eeb

View file

@ -11,7 +11,7 @@ module.exports = async (message) => {
if (message.author.bot) return;
// don't run command if bot can't send messages
if (message.channel.guild && (!message.channel.guild.members.get(client.user.id).permissions.has("sendMessages") || !message.channel.permissionsOf(client.user.id).has("sendMessages"))) return;
if (message.channel.guild && !message.channel.permissionsOf(client.user.id).has("sendMessages")) return;
// this is here to prevent reading the database if a message is unrelated
let valid = false;