Haha-Yes/commands/admin/prune.js

31 lines
841 B
JavaScript
Raw Normal View History

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 {
constructor() {
super('Prune', {
2018-12-30 02:14:43 +01:00
aliases: ['Prune', 'clean', 'purge'],
2018-12-30 01:20:24 +01:00
category: 'admin',
args: [
{
2018-12-30 01:20:24 +01:00
id: "amount",
2018-12-30 01:53:44 +01:00
type: "integer"
}
2018-12-30 01:20:24 +01:00
],
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
});
}
2018-12-30 01:20:24 +01:00
async exec(message,args) {
2018-12-30 02:14:43 +01:00
if (args.amount >= 100) return;
2018-12-30 01:20:24 +01:00
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;