Update for bulkDelete change

This commit is contained in:
Daniel Odendahl Jr
2017-09-26 17:21:16 +00:00
parent 8d686e136b
commit c610b8babb
3 changed files with 8 additions and 8 deletions
+3
View File
@@ -1,4 +1,7 @@
# Dependencies
node_modules/
package-lock.json
# Logs
logs/
*.log
+4 -7
View File
@@ -30,12 +30,9 @@ module.exports = class PruneCommand extends Command {
}
async run(msg, { count }) {
try {
const messages = await msg.channel.messages.fetch({ limit: count + 1 });
await msg.channel.bulkDelete(messages, true);
return null;
} catch (err) {
return msg.say('There are no messages younger than two weeks that can be deleted.');
}
const messages = await msg.channel.messages.fetch({ limit: count + 1 });
const msgs = await msg.channel.bulkDelete(messages, true);
if (!msgs.size) return msg.say('There are no messages younger than two weeks that can be deleted.');
return null;
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "42.12.4",
"version": "42.12.5",
"description": "Your personal server companion.",
"main": "Shard.js",
"scripts": {