Haha-Yes/commands/admin/prune.js

28 lines
896 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-08 02:25:58 +02:00
aliases: ['purge'],
2018-09-07 23:57:33 +02:00
group: 'fun',
memberName: 'prune',
description: 'Replies with a meow, kitty cat.',
clientPermissions: ['MANAGE_MESSAGES'],
userPermissions: ['MANAGE_MESSAGES'],
args: [
{
key: 'amount',
prompt: 'How many messages would you like to delete?',
type: 'integer',
}
]
});
}
run(message, { amount }) {
if (amount < 2 || amount > 100) {
return message.reply('you need to input a number between 2 and 100.');
}
message.channel.bulkDelete(amount, true);
}
};