aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/kick.ts
diff options
context:
space:
mode:
authorTymanWasTaken <tyman@tyman.tech>2021-05-16 20:30:34 -0400
committerTymanWasTaken <tyman@tyman.tech>2021-05-16 20:30:34 -0400
commit372718e567e060cead16dde5d6d190666b4dd575 (patch)
tree1fad29305b6277838833a7e8ae4381136212f301 /src/commands/moderation/kick.ts
parent1db014860c3cf6070bb29f75b6a8cf08070e5b9a (diff)
downloadtanzanite-372718e567e060cead16dde5d6d190666b4dd575.tar.gz
tanzanite-372718e567e060cead16dde5d6d190666b4dd575.tar.bz2
tanzanite-372718e567e060cead16dde5d6d190666b4dd575.zip
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
Diffstat (limited to 'src/commands/moderation/kick.ts')
-rw-r--r--src/commands/moderation/kick.ts18
1 files changed, 16 insertions, 2 deletions
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 <member> <reason>',
+ examples: ['kick @Tyman being cool']
+ }
});
}
async exec(
@@ -29,6 +34,15 @@ export default class PrefixCommand extends BotCommand {
{ user, reason }: { user: GuildMember; reason?: string }
): Promise<void> {
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,