aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/warn.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/moderation/warn.ts')
-rw-r--r--src/commands/moderation/warn.ts22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/commands/moderation/warn.ts b/src/commands/moderation/warn.ts
index 41e0032..3410d81 100644
--- a/src/commands/moderation/warn.ts
+++ b/src/commands/moderation/warn.ts
@@ -1,11 +1,12 @@
import { GuildMember, Message } from 'discord.js';
-import { BotCommand } from '../../lib/extensions/BotCommand';
+import { BushCommand } from '../../lib/extensions/BushCommand';
import { Guild, Modlog, ModlogType } from '../../lib/models';
-export default class WarnCommand extends BotCommand {
+export default class WarnCommand extends BushCommand {
public constructor() {
super('warn', {
aliases: ['warn'],
+ category: 'moderation',
userPermissions: ['MANAGE_MESSAGES'],
args: [
{
@@ -24,10 +25,7 @@ export default class WarnCommand extends BotCommand {
}
});
}
- public async exec(
- message: Message,
- { member, reason }: { member: GuildMember; reason: string }
- ): Promise<void> {
+ public async exec(message: Message, { member, reason }: { member: GuildMember; reason: string }): Promise<void> {
// Create guild entry so postgres doesn't get mad when I try and add a modlog entry
await Guild.findOrCreate({
where: {
@@ -47,21 +45,15 @@ export default class WarnCommand extends BotCommand {
});
await entry.save();
} catch (e) {
- await message.util.send(
- 'Error saving to database, please contact the developers'
- );
+ await message.util.send('Error saving to database, please contact the developers');
return;
}
try {
- await member.send(
- `You were warned in ${message.guild.name} for reason "${reason}".`
- );
+ await member.send(`You were warned in ${message.guild.name} for reason "${reason}".`);
} catch (e) {
await message.util.send('Error messaging user, warning still saved.');
return;
}
- await message.util.send(
- `${member.user.tag} was warned for reason "${reason}".`
- );
+ await message.util.send(`${member.user.tag} was warned for reason "${reason}".`);
}
}