Catch some stuff

This commit is contained in:
Daniel Odendahl Jr
2017-10-18 13:03:50 +00:00
parent c6ada36364
commit 59e97ed348
8 changed files with 34 additions and 19 deletions
+5 -1
View File
@@ -50,7 +50,11 @@ module.exports = class KickCommand extends Command {
} catch (err) {
await msg.say('Failed to send DM.');
}
await member.kick(`${msg.author.tag}: ${reason}`);
try {
await member.kick(`${msg.author.tag}: ${reason}`);
} catch (err) {
return msg.say(`Failed to kick ${member.user.tag}: \`${err.message}\`.`);
}
return msg.say(`Successfully kicked ${member.user.tag}.`);
}
};