diff --git a/commands/admin/moderation.js b/commands/admin/moderation.js index 604947f..c6ac914 100644 --- a/commands/admin/moderation.js +++ b/commands/admin/moderation.js @@ -16,16 +16,16 @@ function kick(guild, user) { async function toggle_ban(guild, message, args, ban, reason) { - var user = args[0]; - let i = 0; - while (user.indexOf('#') == -1) { - user += args[i]; - i++ - } if (ban) { - guild.members.ban(user); + guild.members.ban(args); } else { + var user = args[0]; + let i = 0; + while (user.indexOf('#') == -1) { + user += args[i]; + i++ + } return new Promise((resolve, reject) => { message.guild.bans.fetch().then((users) => { const userObj = users.filter((u) => { diff --git a/commands/log.js b/commands/log.js index 99a28ca..958710a 100644 --- a/commands/log.js +++ b/commands/log.js @@ -23,6 +23,7 @@ function log(bot, message, command, mentioned, reason, severity) { if (!doc) { return message.channel.send("Server logs not set up yet!"); } const channel = message.guild.channels.cache.get(doc.logchannel); + if (!channel) { return console.log("There is no specified log channel!"); } //Check severity threshold if (SEVCODES[doc.severity] < severity) { return; }