mirror of
https://github.com/DarthKilroy/Spot.git
synced 2025-12-22 19:56:49 +00:00
Remove unused code, clean up folder tree
This commit is contained in:
parent
a4892d854b
commit
1e8c1261f5
14 changed files with 38 additions and 80 deletions
28
command/clean.js
Normal file
28
command/clean.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
const Logger = require('@lilywonhalf/pretty-logger');
|
||||
const Config = require('../config.json');
|
||||
const CommandCategory = require('../model/command-category');
|
||||
const CommandPermission = require('../model/command-permission');
|
||||
|
||||
class Clean
|
||||
{
|
||||
constructor() {
|
||||
this.aliases = ['clear', 'purge'];
|
||||
this.category = CommandCategory.MODERATION;
|
||||
this.isAllowedForContext = CommandPermission.isMemberMod;
|
||||
this.description = 'Deletes messages in a bulk.';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Message} message
|
||||
* @param {Array} args
|
||||
*/
|
||||
async process(message, args) {
|
||||
if (args.length > 0 && parseInt(args[0]) > 0) {
|
||||
await message.channel.bulkDelete(Math.min(parseInt(args[0]) + 1, 100));
|
||||
} else {
|
||||
message.reply(`You have to tell me how many messages I should clean. \`${Config.prefix}clean 10\` for example.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new Clean();
|
||||
Loading…
Add table
Add a link
Reference in a new issue