mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 06:42:51 +02:00
Remove moderation group
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
|
||||
module.exports = class PruneCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'prune',
|
||||
aliases: ['clear'],
|
||||
group: 'other',
|
||||
memberName: 'prune',
|
||||
description: 'Deletes up to 99 messages from the current channel.',
|
||||
guildOnly: true,
|
||||
throttling: {
|
||||
usages: 1,
|
||||
duration: 15
|
||||
},
|
||||
clientPermissions: ['READ_MESSAGE_HISTORY', 'MANAGE_MESSAGES'],
|
||||
userPermissions: ['MANAGE_MESSAGES'],
|
||||
args: [
|
||||
{
|
||||
key: 'count',
|
||||
label: 'amount of messages',
|
||||
prompt: 'How many messages do you want to delete? Limit of up to 99.',
|
||||
type: 'integer',
|
||||
min: 1,
|
||||
max: 99
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { count }) {
|
||||
try {
|
||||
const messages = await msg.channel.messages.fetch({ limit: count + 1 });
|
||||
const msgs = await msg.channel.bulkDelete(messages, true);
|
||||
if (!msgs.size) return msg.reply('There are no messages younger than two weeks that can be deleted.');
|
||||
return null;
|
||||
} catch (err) {
|
||||
return msg.reply('There are no messages younger than two weeks that can be deleted.');
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user