From 56e6419c0255563b6a7e20a0dac252308640e23d Mon Sep 17 00:00:00 2001 From: TheEssem Date: Sun, 12 Apr 2020 15:59:23 -0500 Subject: [PATCH] Fixed glaring oversight in channel --- commands/channel.js | 1 + 1 file changed, 1 insertion(+) diff --git a/commands/channel.js b/commands/channel.js index 335270e..fc1fe90 100644 --- a/commands/channel.js +++ b/commands/channel.js @@ -1,6 +1,7 @@ const db = require("../utils/database.js"); exports.run = async (message, args) => { + if (!message.member.permission.has("administrator") && message.member.id !== process.env.OWNER) return `${message.author.mention}, you need to be an administrator to enable/disable me!`; if (args.length === 0) return `${message.author.mention}, you need to provide whether I should be enabled or disabled in this channel!`; if (args[0] !== "disable" && args[0] !== "enable") return `${message.author.mention}, that's not a valid option!`; const guildDB = (await db.guilds.find({id: message.channel.guild.id}).exec())[0];