Fixed glaring oversight in channel

This commit is contained in:
TheEssem 2020-04-12 15:59:23 -05:00
parent c50e0d7319
commit 56e6419c02

View file

@ -1,6 +1,7 @@
const db = require("../utils/database.js"); const db = require("../utils/database.js");
exports.run = async (message, args) => { 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.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!`; 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]; const guildDB = (await db.guilds.find({id: message.channel.guild.id}).exec())[0];