Prune Error Catch

This commit is contained in:
Daniel Odendahl Jr
2017-03-31 00:22:08 +00:00
parent daac22f385
commit 698262d24c
+3 -2
View File
@@ -44,10 +44,11 @@ module.exports = class PruneCommand extends commando.Command {
let messages = await message.channel.fetchMessages({ let messages = await message.channel.fetchMessages({
limit: count limit: count
}); });
message.channel.bulkDelete(messages, true); let deletion = await message.channel.bulkDelete(messages, true);
return deletion;
} }
catch (err) { catch (err) {
return message.say(':x: Error! Something went wrong!'); return message.say(':x: Error! Something went wrong! Perhaps there are not enough messages in the channel from earlier than two weeks?');
} }
} }
}; };