mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Update for bulkDelete change
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
# Dependencies
|
||||
node_modules/
|
||||
package-lock.json
|
||||
|
||||
# Logs
|
||||
logs/
|
||||
*.log
|
||||
|
||||
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "42.12.4",
|
||||
"version": "42.12.5",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Shard.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user