You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Haha-Yes/commands/admin/prune.js

28 lines
894 B
JavaScript

6 years ago
const { Command } = require('discord.js-commando');
module.exports = class PruneCommand extends Command {
constructor(client) {
super(client, {
name: 'prune',
6 years ago
aliases: ['purge'],
group: 'admin',
6 years ago
memberName: 'prune',
description: 'Bulk delete messages.',
6 years ago
clientPermissions: ['MANAGE_MESSAGES'],
userPermissions: ['MANAGE_MESSAGES'],
args: [
{
key: 'amount',
prompt: 'How many messages would you like to delete?',
type: 'integer',
}
]
});
}
6 years ago
async run(message, { amount }) {
6 years ago
if (amount < 2 || amount > 100) {
return message.reply('you need to input a number between 2 and 100.');
}
message.channel.bulkDelete(amount, true);
}
};