Skip to content

Commit

Permalink
Merge pull request #217 from aternosorg/caps
Browse files Browse the repository at this point in the history
refactor caps command
  • Loading branch information
matthi4s authored Mar 8, 2021
2 parents 10ac976 + b12776c commit de17b86
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 40 deletions.
40 changes: 0 additions & 40 deletions src/commands/legacy/caps.js

This file was deleted.

39 changes: 39 additions & 0 deletions src/commands/settings/caps.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const Command = require('../../Command');

class CapsCommand extends Command {

static description = 'Configure caps moderation (deletes messages with 70%+ caps)';

static usage = 'on|off|status';

static names = ['caps','capsmod'];

static userPerms = ['MANAGE_GUILD'];

async execute() {
if (this.args.length !== 1) {
await this.sendUsage();
return;
}

switch (this.args[0].toLowerCase()) {
case "on":
this.guildConfig.caps = true;
await this.guildConfig.save();
await this.message.channel.send("Enabled caps moderation!")
break;
case "off":
this.guildConfig.caps = false;
await this.guildConfig.save();
await this.message.channel.send("Disabled caps moderation!")
break;
case "status":
await this.message.channel.send(`Caps moderation is currently ${this.guildConfig.caps === false ? 'disabled' : 'enabled'}.`);
break;
default:
await this.sendUsage();
}
}
}

module.exports = CapsCommand;

0 comments on commit de17b86

Please sign in to comment.