Allow modlog channel to be swapped

This commit is contained in:
Daniel Odendahl Jr
2017-06-24 21:14:12 +00:00
parent fbf50718c6
commit 29a1c9b947
8 changed files with 28 additions and 8 deletions
+5 -1
View File
@@ -33,7 +33,11 @@ module.exports = class KickCommand extends Command {
}
async run(msg, args) {
const modlogs = msg.guild.channels.find('name', 'mod-log');
const modlogs = msg.guild.channels.filter((c) => {
const topic = c.topic || '';
if (topic.includes('<modlog>')) return true;
else return false;
}).first() || member.guild.channels.find('name', 'mod-log');
const { member, reason } = args;
if (!member.kickable) return msg.say('This member is not kickable. Perhaps they have a higher role than me?');
await msg.say(`Are you sure you want to kick ${member.user.tag} (${member.id})?`);