Haha-Yes/commands/admin/prune.js

31 lines
947 B
JavaScript
Raw Normal View History

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.',
clientPermissions: ['READ_MESSAGE_HISTORY', 'MANAGE_MESSAGES'],
userPermissions: ['MANAGE_MESSAGES'],
guildOnly: true,
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
});
}
run(message, { amount }) {
amount = amount+1
message.channel.bulkDelete(amount, true);
}
};
2018-09-09 21:40:45 +02:00