-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #217 from aternosorg/caps
refactor caps command
- Loading branch information
Showing
2 changed files
with
39 additions
and
40 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |