2018-12-30 01:20:24 +01:00
|
|
|
const { Command } = require('discord-akairo');
|
2018-12-25 19:17:07 +01:00
|
|
|
|
2018-12-30 01:20:24 +01:00
|
|
|
class PruneCommand extends Command {
|
2019-01-02 08:09:45 +01:00
|
|
|
constructor() {
|
|
|
|
super('Prune', {
|
|
|
|
aliases: ['Prune', 'clean', 'purge'],
|
|
|
|
category: 'admin',
|
|
|
|
args: [
|
|
|
|
{
|
|
|
|
id: 'amount',
|
|
|
|
type: 'integer'
|
|
|
|
}
|
|
|
|
],
|
|
|
|
clientPermissions: ['MANAGE_MESSAGES'],
|
|
|
|
userPermissions: ['MANAGE_MESSAGES'],
|
|
|
|
channelRestriction: 'guild',
|
|
|
|
description: {
|
|
|
|
content: 'Bulk delete messages',
|
|
|
|
usage: '[amount]',
|
|
|
|
examples: ['50']
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2018-09-07 23:57:33 +02:00
|
|
|
|
2019-01-02 08:09:45 +01:00
|
|
|
async exec(message,args) {
|
|
|
|
if (args.amount >= 100) return;
|
|
|
|
message.channel.bulkDelete(args.amount + 1, true);
|
|
|
|
}
|
2018-12-30 01:20:24 +01:00
|
|
|
}
|
2018-09-09 21:40:45 +02:00
|
|
|
|
2018-12-30 01:20:24 +01:00
|
|
|
module.exports = PruneCommand;
|