diff --git a/discord_bot.js b/discord_bot.js index f205393..6661fa8 100644 --- a/discord_bot.js +++ b/discord_bot.js @@ -289,7 +289,7 @@ var commands = { usage: "", extendedhelp: "I'll delete a certain ammount of messages.", process: function(bot, msg, suffix) { - if (msg.channel.isPrivate) { + if (!msg.channel.server) { bot.sendMessage(msg.channel, "You can't do that in a DM, dummy!"); return; } @@ -327,14 +327,14 @@ var commands = { extendedhelp: "KappaKappaKappaKappaKappaKappaKappaKappaKappaKappa", process: function(bot, msg, suffix) { bot.sendFile(msg.channel, "./images/kappa.png"); - if (msg.channel.isPrivate){return;} + if (msg.channel.server){ var bot_permissions = msg.channel.permissionsOf(bot.user); if (bot_permissions.hasPermission("manageMessages")) { bot.deleteMessage(msg); return; } else { bot.sendMessage(msg.channel, "*This works best when I have the permission to delete messages!*"); - } + }} } }, "iff": { @@ -356,14 +356,14 @@ var commands = { } if (imgArray.indexOf(suffix) !== -1) { bot.sendFile(msg.channel, "./images/" + suffix); - if (msg.channel.isPrivate){return;} + if (msg.channel.server){ var bot_permissions = msg.channel.permissionsOf(bot.user); if (bot_permissions.hasPermission("manageMessages")) { bot.deleteMessage(msg); return; } else { bot.sendMessage(msg.channel, "*This works best when I have the permission to delete messages!*"); - } + }} } else { bot.sendMessage(msg.channel, "*Invalid input!*"); } @@ -441,14 +441,14 @@ var commands = { // bot.sendMessage(msg.channel, suffix, true + "-" + msg.author); // This line makes no sense... it appears there is an attempt to add "-"+msg.author to the suffix, and true is supposed to enable the boolean /tts function. This command is useless if it adds the msg.author, so I'll just fix tts for now now lol bot.sendMessage(msg.channel, suffix); - if (msg.channel.isPrivate){return;} + if (msg.channel.server){ var bot_permissions = msg.channel.permissionsOf(bot.user); if (bot_permissions.hasPermission("manageMessages")) { bot.deleteMessage(msg); return; } else { bot.sendMessage(msg.channel, "*This works best when I have the permission to delete messages!*"); - } + }} } else { bot.sendMessage(msg.channel, "HEY " + msg.sender + " STOP THAT!", {tts:"true"}); } @@ -462,14 +462,14 @@ var commands = { process: function(bot, msg, suffix) { if (suffix.search("!say") === -1) { bot.sendMessage(msg.channel, suffix, {tts:"true"}); - if (msg.channel.isPrivate){return;} + if (msg.channel.server){ var bot_permissions = msg.channel.permissionsOf(bot.user); if (bot_permissions.hasPermission("manageMessages")) { bot.deleteMessage(msg); return; } else { bot.sendMessage(msg.channel, "*This works best when I have the permission to delete messages!*"); - } + }} } else { bot.sendMessage(msg.channel, "HEY " + msg.sender + " STOP THAT!", {tts:"true"}); } @@ -484,14 +484,14 @@ var commands = { if (suffix.search("!say") === -1) { var d = new Date(); bot.sendMessage(msg.channel,'"' + suffix + '"' + ' -' + msg.author + ' ' + d.getFullYear(), {tts:"true"}); - if (msg.channel.isPrivate){return;} + if (msg.channel.server){ var bot_permissions = msg.channel.permissionsOf(bot.user); if (bot_permissions.hasPermission("manageMessages")) { bot.deleteMessage(msg); return; } else { bot.sendMessage(msg.channel, "*This works best when I have the permission to delete messages!*"); - } + }} } else { bot.sendMessage(msg.channel, "HEY " + msg.sender + " STOP THAT!", {tts:"true"}); } @@ -600,14 +600,14 @@ var commands = { imgflipper.generateMeme(meme[memetype], tags[1] ? tags[1] : "", tags[3] ? tags[3] : "", function(err, image) { //CmdErrorLog.log("debug", arguments); bot.sendMessage(msg.channel, image); - if (msg.channel.isPrivate){return;} + if (msg.channel.server){ var bot_permissions = msg.channel.permissionsOf(bot.user); if (bot_permissions.hasPermission("manageMessages")) { bot.deleteMessage(msg); return; } else { bot.sendMessage(msg.channel, "*This works best when I have the permission to delete messages!*"); - } + }} }); } },