Fix time checking using the wrong function
All checks were successful
Test / build (push) Successful in 13s
All checks were successful
Test / build (push) Successful in 13s
This commit is contained in:
parent
40a9764192
commit
6c48da114a
1 changed files with 5 additions and 6 deletions
|
@ -33,8 +33,7 @@ export default async function AutoKick() {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
|
|
||||||
if (whenToKick < now) {
|
if (whenToKick < now) {
|
||||||
// await member.kick("Auto Kicked");
|
await member.kick("Auto Kicked");
|
||||||
console.log("Kicked");
|
|
||||||
|
|
||||||
if (config.NoticeChannelId) {
|
if (config.NoticeChannelId) {
|
||||||
const channel = guild.channels.cache.find(x => x.id == config.NoticeChannelId) || await guild.channels.fetch(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()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle("Auto Kicked User")
|
.setTitle("Auto Kicked User")
|
||||||
.setColor(EmbedColours.Danger)
|
.setColor(EmbedColours.Danger)
|
||||||
.setThumbnail(member.avatarURL())
|
.setThumbnail(member.user.avatarURL())
|
||||||
.addFields([
|
.addFields([
|
||||||
{
|
{
|
||||||
name: "User",
|
name: "User",
|
||||||
|
@ -60,7 +59,7 @@ export default async function AutoKick() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (config.NoticeChannelId && config.NoticeTime) {
|
} 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);
|
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()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle("Auto Kick Notice")
|
.setTitle("Auto Kick Notice")
|
||||||
.setColor(EmbedColours.Warning)
|
.setColor(EmbedColours.Warning)
|
||||||
.setThumbnail(member.avatarURL())
|
.setThumbnail(member.user.avatarURL())
|
||||||
.addFields([
|
.addFields([
|
||||||
{
|
{
|
||||||
name: "User",
|
name: "User",
|
||||||
|
@ -83,7 +82,7 @@ export default async function AutoKick() {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "When To Kick",
|
name: "When To Kick",
|
||||||
value: `<t:${whenToKick.getMilliseconds()}:R>`,
|
value: `<t:${Math.round(whenToKick.getTime() / 1000)}:R>`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in a new issue