2018-09-07 23:57:33 +02:00
|
|
|
const { Command } = require('discord.js-commando');
|
|
|
|
module.exports = class PruneCommand extends Command {
|
|
|
|
constructor(client) {
|
|
|
|
super(client, {
|
|
|
|
name: 'prune',
|
2018-09-21 14:03:01 +02:00
|
|
|
aliases: ['purge', 'clear', 'clean'],
|
2018-09-08 16:13:47 +02:00
|
|
|
group: 'admin',
|
2018-09-07 23:57:33 +02:00
|
|
|
memberName: 'prune',
|
2018-09-08 16:13:47 +02:00
|
|
|
description: 'Bulk delete messages.',
|
2018-09-16 21:58:14 +02:00
|
|
|
clientPermissions: ['READ_MESSAGE_HISTORY', 'MANAGE_MESSAGES'],
|
2018-09-17 16:32:27 +02:00
|
|
|
userPermissions: ['MANAGE_MESSAGES'],
|
|
|
|
guildOnly: true,
|
2018-09-16 21:58:14 +02:00
|
|
|
args: [
|
|
|
|
{
|
|
|
|
key: 'amount',
|
|
|
|
prompt: 'How many messages would you like to delete? ( choose a number between 1 & 99 )',
|
|
|
|
type: 'integer',
|
|
|
|
min: '1',
|
|
|
|
max: '99'
|
|
|
|
}
|
|
|
|
]
|
2018-09-07 23:57:33 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-09-16 21:58:14 +02:00
|
|
|
run(message, { amount }) {
|
|
|
|
amount = amount+1
|
|
|
|
message.channel.bulkDelete(amount, true);
|
|
|
|
}
|
|
|
|
};
|
2018-09-09 21:40:45 +02:00
|
|
|
|