IM GONNA DELETE U OUT
This commit is contained in:
parent
d28559c43b
commit
5a02cb48f9
1 changed files with 29 additions and 0 deletions
29
commands/System/purge.js
Normal file
29
commands/System/purge.js
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
exports.run = async (client, message, args, level) => {
|
||||||
|
let filter = true
|
||||||
|
|
||||||
|
let count = parseInt(args[0]) || 1;
|
||||||
|
|
||||||
|
let responsePlace = message.channel;
|
||||||
|
await message.delete();
|
||||||
|
|
||||||
|
const messages = await message.channel.fetchMessages({ limit: Math.min(count, 100), before: message.id });
|
||||||
|
const deleted = messages.size;
|
||||||
|
|
||||||
|
message.channel.bulkDelete(messages.size);
|
||||||
|
|
||||||
|
(await responsePlace.send(`:white_check_mark: **Cleared \`${messages.size}\` message${deleted === 1 ? '' : 's'}.**`)).delete(2000);
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.conf = {
|
||||||
|
enabled: true,
|
||||||
|
guildOnly: false,
|
||||||
|
aliases: [],
|
||||||
|
permLevel: "User"
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.help = {
|
||||||
|
name: "purge",
|
||||||
|
category: "System",
|
||||||
|
description: "Get those messages out of here, will ya?",
|
||||||
|
usage: "purge <amount>"
|
||||||
|
};
|
Loading…
Reference in a new issue