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
+9 -5
View File
@@ -50,11 +50,15 @@ module.exports = class SoftbanCommand extends Command {
} catch (err) {
await msg.say('Failed to send DM.');
}
await member.ban({
days: 7,
reason: `${msg.author.tag}: ${reason} (Softban)`
});
await msg.guild.unban(member.user, 'Softban');
try {
await member.ban({
days: 7,
reason: `${msg.author.tag}: ${reason} (Softban)`
});
await msg.guild.unban(member.user, 'Softban');
} catch (err) {
return msg.say(`Failed to softban ${member.user.tag}: \`${err.message}\`.`);
}
return msg.say(`Successfully softbanned ${member.user.tag}.`);
}
};