Haha-Yes/commands/admin/prune.js

34 lines
722 B
JavaScript
Raw Permalink 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 {
2019-01-02 08:09:45 +01:00
constructor() {
super('Prune', {
aliases: ['Prune', 'clean', 'purge', 'clear'],
2019-01-02 08:09:45 +01:00
category: 'admin',
args: [
{
id: 'amount',
2019-06-23 03:41:59 +02:00
prompt: {
start: 'How many message should i delete?',
},
2019-01-02 08:09:45 +01:00
type: 'integer'
}
],
2019-11-09 12:04:01 +01:00
clientPermissions: ['MANAGE_MESSAGES', 'SEND_MESSAGES'],
2019-01-02 08:09:45 +01:00
userPermissions: ['MANAGE_MESSAGES'],
2020-03-19 23:24:31 +01:00
channel: 'guild',
2019-01-02 08:09:45 +01:00
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;