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

34 lines
722 B
JavaScript

const { Command } = require('discord-akairo');
5 years ago
class PruneCommand extends Command {
5 years ago
constructor() {
super('Prune', {
aliases: ['Prune', 'clean', 'purge', 'clear'],
5 years ago
category: 'admin',
args: [
{
id: 'amount',
5 years ago
prompt: {
start: 'How many message should i delete?',
},
5 years ago
type: 'integer'
}
],
5 years ago
clientPermissions: ['MANAGE_MESSAGES', 'SEND_MESSAGES'],
5 years ago
userPermissions: ['MANAGE_MESSAGES'],
channel: 'guild',
5 years ago
description: {
content: 'Bulk delete messages',
usage: '[amount]',
examples: ['50']
}
});
}
6 years ago
5 years ago
async exec(message,args) {
if (args.amount >= 100) return;
message.channel.bulkDelete(args.amount + 1, true);
}
}
module.exports = PruneCommand;