From 372718e567e060cead16dde5d6d190666b4dd575 Mon Sep 17 00:00:00 2001 From: TymanWasTaken Date: Sun, 16 May 2021 20:30:34 -0400 Subject: add colored logging and improved logging code, fix a few moderation command issues, add more logging, and make ban check run every 30s not 60s --- src/commands/moderation/kick.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/commands/moderation/kick.ts') diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts index dcd19de..23fc092 100644 --- a/src/commands/moderation/kick.ts +++ b/src/commands/moderation/kick.ts @@ -1,6 +1,6 @@ import { BotCommand } from '../../lib/extensions/BotCommand'; import { BotMessage } from '../../lib/extensions/BotMessage'; -import { Modlog, ModlogType } from '../../lib/models'; +import { Guild, Modlog, ModlogType } from '../../lib/models'; import { GuildMember } from 'discord.js'; export default class PrefixCommand extends BotCommand { @@ -21,7 +21,12 @@ export default class PrefixCommand extends BotCommand { } ], clientPermissions: ['KICK_MEMBERS'], - userPermissions: ['KICK_MEMBERS'] + userPermissions: ['KICK_MEMBERS'], + description: { + content: 'Kick a member and log it in modlogs', + usage: 'kick ', + examples: ['kick @Tyman being cool'] + } }); } async exec( @@ -29,6 +34,15 @@ export default class PrefixCommand extends BotCommand { { user, reason }: { user: GuildMember; reason?: string } ): Promise { let modlogEnry: Modlog; + // Create guild entry so postgres doesn't get mad when I try and add a modlog entry + await Guild.findOrCreate({ + where: { + id: message.guild.id + }, + defaults: { + id: message.guild.id + } + }); try { modlogEnry = Modlog.build({ user: user.id, -- cgit