From 6c48da114af26436af81ba6c85e2a8169f1b4e6e Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Sat, 28 Dec 2024 16:38:07 +0000 Subject: [PATCH] Fix time checking using the wrong function --- src/timers/AutoKick.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/timers/AutoKick.ts b/src/timers/AutoKick.ts index a98aee8..61f743a 100644 --- a/src/timers/AutoKick.ts +++ b/src/timers/AutoKick.ts @@ -33,8 +33,7 @@ export default async function AutoKick() { const now = new Date(); if (whenToKick < now) { - // await member.kick("Auto Kicked"); - console.log("Kicked"); + await member.kick("Auto Kicked"); if (config.NoticeChannelId) { const channel = guild.channels.cache.find(x => x.id == config.NoticeChannelId) || await guild.channels.fetch(config.NoticeChannelId); @@ -46,7 +45,7 @@ export default async function AutoKick() { const embed = new EmbedBuilder() .setTitle("Auto Kicked User") .setColor(EmbedColours.Danger) - .setThumbnail(member.avatarURL()) + .setThumbnail(member.user.avatarURL()) .addFields([ { name: "User", @@ -60,7 +59,7 @@ export default async function AutoKick() { }); } } else if (config.NoticeChannelId && config.NoticeTime) { - const whenToNotice = new Date(whenToKick.getMilliseconds() - config.NoticeTime); + const whenToNotice = new Date(whenToKick.getTime() - config.NoticeTime); const channel = guild.channels.cache.find(x => x.id == config.NoticeChannelId) || await guild.channels.fetch(config.NoticeChannelId); @@ -74,7 +73,7 @@ export default async function AutoKick() { const embed = new EmbedBuilder() .setTitle("Auto Kick Notice") .setColor(EmbedColours.Warning) - .setThumbnail(member.avatarURL()) + .setThumbnail(member.user.avatarURL()) .addFields([ { name: "User", @@ -83,7 +82,7 @@ export default async function AutoKick() { }, { name: "When To Kick", - value: ``, + value: ``, inline: true, }, ]);