diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-06-24 00:56:16 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-06-24 00:56:16 -0400 |
commit | 4176b6258e44e4a095376aaf0f4c687244243a69 (patch) | |
tree | 3b9144be9a2045483c90d92fff05b3ca0b288e52 /src/commands/moderation/kick.ts | |
parent | e80446e23060c0325bbd6db620920d86694ec3ce (diff) | |
download | tanzanite-4176b6258e44e4a095376aaf0f4c687244243a69.tar.gz tanzanite-4176b6258e44e4a095376aaf0f4c687244243a69.tar.bz2 tanzanite-4176b6258e44e4a095376aaf0f4c687244243a69.zip |
feat(*): Began working on other punishment commands etc
Diffstat (limited to 'src/commands/moderation/kick.ts')
-rw-r--r-- | src/commands/moderation/kick.ts | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index d00ae55..eed3038 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -1,7 +1,7 @@ import { CommandInteraction, GuildMember, Message } from 'discord.js'; import { BushCommand } from '../../lib/extensions/BushCommand'; import { BushSlashMessage } from '../../lib/extensions/BushInteractionMessage'; -import { Guild, Modlog, ModlogType } from '../../lib/models'; +import { Guild, ModLog, ModLogType } from '../../lib/models'; export default class KickCommand extends BushCommand { constructor() { @@ -14,17 +14,19 @@ export default class KickCommand extends BushCommand { type: 'member', prompt: { start: 'What user would you like to kick?', - retry: 'Invalid response. What user would you like to kick?' + retry: '{error} Choose a valid user to kick.' } }, { - id: 'reason' + id: 'reason', + type: 'string', + match: 'restContent' } ], clientPermissions: ['KICK_MEMBERS'], userPermissions: ['KICK_MEMBERS'], description: { - content: 'Kick a member and log it in modlogs', + content: 'Kick a member from the server.', usage: 'kick <member> <reason>', examples: ['kick @Tyman being cool'] }, @@ -51,7 +53,7 @@ export default class KickCommand extends BushCommand { user: GuildMember, reason?: string ): AsyncIterable<string> { - let modlogEnry: Modlog; + let modlogEnry: ModLog; // Create guild entry so postgres doesn't get mad when I try and add a modlog entry await Guild.findOrCreate({ where: { @@ -62,16 +64,16 @@ export default class KickCommand extends BushCommand { } }); try { - modlogEnry = Modlog.build({ + modlogEnry = ModLog.build({ user: user.id, guild: message.guild.id, moderator: message instanceof Message ? message.author.id : message.user.id, - type: ModlogType.KICK, + type: ModLogType.KICK, reason }); await modlogEnry.save(); } catch (e) { - this.client.console.error(`BanCommand`, `Error saving to database. ${e?.stack}`); + this.client.console.error(`KickCommand`, `Error saving to database. ${e?.stack}`); yield `${this.client.util.emojis.error} Error saving to database. Please report this to a developer.`; return; } |