diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-06 15:20:46 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-06 15:20:46 -0400 |
commit | 13306f17accea5d3653dd4b8670ba0d6ab69c7c5 (patch) | |
tree | 7075dcca19ed1164a166efac19c49311e93ffeee /src/commands/moderation/hideCase.ts | |
parent | a8386e756758f243b75e5df4886224d2bf9f241c (diff) | |
download | tanzanite-13306f17accea5d3653dd4b8670ba0d6ab69c7c5.tar.gz tanzanite-13306f17accea5d3653dd4b8670ba0d6ab69c7c5.tar.bz2 tanzanite-13306f17accea5d3653dd4b8670ba0d6ab69c7c5.zip |
evidence command and more logging
Diffstat (limited to 'src/commands/moderation/hideCase.ts')
-rw-r--r-- | src/commands/moderation/hideCase.ts | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/commands/moderation/hideCase.ts b/src/commands/moderation/hideCase.ts index 6cd8e31..2529531 100644 --- a/src/commands/moderation/hideCase.ts +++ b/src/commands/moderation/hideCase.ts @@ -7,12 +7,12 @@ export default class HideCaseCommand extends BushCommand { category: 'moderation', description: { content: 'Hide a particular modlog case from the modlog command unless the `--hidden` flag is specified', - usage: 'hideCase <caseID>', + usage: 'hideCase <case_id>', examples: ['hideCase 9210b1ea-91f5-4ea2-801b-02b394469c77'] }, args: [ { - id: 'case', + id: 'case_id', type: 'string', prompt: { start: 'What modlog case would you like to hide?', @@ -24,7 +24,7 @@ export default class HideCaseCommand extends BushCommand { slash: true, slashOptions: [ { - name: 'case', + name: 'case_id', description: 'What modlog case would you like to hide?', type: 'STRING', required: true @@ -34,7 +34,10 @@ export default class HideCaseCommand extends BushCommand { }); } - public override async exec(message: BushMessage | BushSlashMessage, { case: caseID }: { case: string }): Promise<unknown> { + public override async exec( + message: BushMessage | BushSlashMessage, + { case_id: caseID }: { case_id: string } + ): Promise<unknown> { if (message.author.id === '496409778822709251') return await message.util.reply(`${util.emojis.error} This command is Bestower proof.`); const entry = await ModLog.findByPk(caseID); @@ -42,9 +45,12 @@ export default class HideCaseCommand extends BushCommand { if (entry.guild !== message.guild!.id) return message.util.reply(`${util.emojis.error} This modlog is from another server.`); const action = entry.hidden ? 'no longer hidden' : 'now hidden'; + const oldEntry = entry.hidden; entry.hidden = !entry.hidden; await entry.save(); + client.emit('bushUpdateModlog', message.member!, entry.id, 'hidden', oldEntry, entry.hidden); + return await message.util.reply(`${util.emojis.success} CaseID \`${caseID}\` is ${action}.`); } } |