aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/modlog.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/moderation/modlog.ts')
-rw-r--r--src/commands/moderation/modlog.ts26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/commands/moderation/modlog.ts b/src/commands/moderation/modlog.ts
index 320c6b4..806c00a 100644
--- a/src/commands/moderation/modlog.ts
+++ b/src/commands/moderation/modlog.ts
@@ -1,4 +1,4 @@
-import { BotCommand } from '../../lib/extensions/BotCommand';
+import { BushCommand } from '../../lib/extensions/BushCommand';
import { Message } from 'discord.js';
import { Modlog } from '../../lib/models';
import { MessageEmbed } from 'discord.js';
@@ -6,10 +6,11 @@ import moment from 'moment';
import { stripIndent } from 'common-tags';
import { Argument } from 'discord-akairo';
-export default class ModlogCommand extends BotCommand {
+export default class ModlogCommand extends BushCommand {
constructor() {
super('modlog', {
aliases: ['modlog', 'modlogs'],
+ category: 'moderation',
args: [
{
id: 'search',
@@ -52,10 +53,7 @@ export default class ModlogCommand extends BotCommand {
return { search, page };
}
}
- async exec(
- message: Message,
- { search, page }: { search: string; page: number }
- ): Promise<void> {
+ async exec(message: Message, { search, page }: { search: string; page: number }): Promise<void> {
const foundUser = await this.client.util.resolveUserAsync(search);
if (foundUser) {
const logs = await Modlog.findAll({
@@ -72,11 +70,7 @@ export default class ModlogCommand extends BotCommand {
Type: ${log.type.toLowerCase()}
User: <@!${log.user}> (${log.user})
Moderator: <@!${log.moderator}> (${log.moderator})
- Duration: ${
- log.duration
- ? moment.duration(log.duration, 'milliseconds').humanize()
- : 'N/A'
- }
+ Duration: ${log.duration ? moment.duration(log.duration, 'milliseconds').humanize() : 'N/A'}
Reason: ${log.reason || 'None given'}
${this.client.util.ordinal(logs.indexOf(log) + 1)} action
`);
@@ -86,9 +80,7 @@ export default class ModlogCommand extends BotCommand {
(e, i) =>
new MessageEmbed({
title: `Modlogs page ${i + 1}`,
- description: e.join(
- '\n-------------------------------------------------------\n'
- ),
+ description: e.join('\n-------------------------------------------------------\n'),
footer: {
text: `Page ${i + 1}/${chunked.length}`
}
@@ -118,11 +110,7 @@ export default class ModlogCommand extends BotCommand {
},
{
name: 'Duration',
- value: `${
- entry.duration
- ? moment.duration(entry.duration, 'milliseconds').humanize()
- : 'N/A'
- }`,
+ value: `${entry.duration ? moment.duration(entry.duration, 'milliseconds').humanize() : 'N/A'}`,
inline: true
},
{