diff options
4 files changed, 12 insertions, 4 deletions
diff --git a/src/listeners/track-manual-punishments/modlogSyncBan.ts b/src/listeners/track-manual-punishments/modlogSyncBan.ts index 88334a4..03024d8 100644 --- a/src/listeners/track-manual-punishments/modlogSyncBan.ts +++ b/src/listeners/track-manual-punishments/modlogSyncBan.ts @@ -1,4 +1,5 @@ import { BushListener, BushUser, Moderation, ModLogType, type BushClientEvents } from '#lib'; +import { AuditLogEvent } from 'discord-api-types'; import { MessageEmbed, Permissions } from 'discord.js'; export default class ModlogSyncBanListener extends BushListener { @@ -23,7 +24,8 @@ export default class ModlogSyncBanListener extends BushListener { const now = new Date(); await util.sleep(0.5); // wait for audit log entry - const logs = (await ban.guild.fetchAuditLogs({ type: 'MemberBanAdd' })).entries.filter( + const logs = (await ban.guild.fetchAuditLogs({ type: AuditLogEvent.MemberBanAdd })).entries.filter( + // @ts-ignore: scuffed typings (entry) => entry.target?.id === ban.user.id ); diff --git a/src/listeners/track-manual-punishments/modlogSyncKick.ts b/src/listeners/track-manual-punishments/modlogSyncKick.ts index f7da96f..9ea6a9d 100644 --- a/src/listeners/track-manual-punishments/modlogSyncKick.ts +++ b/src/listeners/track-manual-punishments/modlogSyncKick.ts @@ -1,4 +1,5 @@ import { BushListener, BushUser, Moderation, ModLogType, type BushClientEvents } from '#lib'; +import { AuditLogEvent } from 'discord-api-types'; import { MessageEmbed, Permissions } from 'discord.js'; export default class ModlogSyncKickListener extends BushListener { @@ -23,7 +24,8 @@ export default class ModlogSyncKickListener extends BushListener { const now = new Date(); await util.sleep(0.5); // wait for audit log entry - const logs = (await member.guild.fetchAuditLogs({ type: 'MemberKick' })).entries.filter( + const logs = (await member.guild.fetchAuditLogs({ type: AuditLogEvent.MemberKick })).entries.filter( + // @ts-ignore: scuffed typings (entry) => entry.target?.id === member.user.id ); diff --git a/src/listeners/track-manual-punishments/modlogSyncTimeout.ts b/src/listeners/track-manual-punishments/modlogSyncTimeout.ts index c28aacf..9b67f43 100644 --- a/src/listeners/track-manual-punishments/modlogSyncTimeout.ts +++ b/src/listeners/track-manual-punishments/modlogSyncTimeout.ts @@ -1,4 +1,5 @@ import { BushListener, BushUser, Moderation, ModLogType, type BushClientEvents } from '#lib'; +import { AuditLogEvent } from 'discord-api-types'; import { MessageEmbed, Permissions } from 'discord.js'; export default class ModlogSyncTimeoutListener extends BushListener { @@ -22,7 +23,8 @@ export default class ModlogSyncTimeoutListener extends BushListener { const now = new Date(); await util.sleep(0.5); // wait for audit log entry - const logs = (await newMember.guild.fetchAuditLogs({ type: 'MemberUpdate' })).entries.filter( + const logs = (await newMember.guild.fetchAuditLogs({ type: AuditLogEvent.MemberUpdate })).entries.filter( + // @ts-ignore: scuffed typings (entry) => entry.target?.id === newMember.user.id ); diff --git a/src/listeners/track-manual-punishments/modlogSyncUnban.ts b/src/listeners/track-manual-punishments/modlogSyncUnban.ts index 2d28e1c..7cdecb0 100644 --- a/src/listeners/track-manual-punishments/modlogSyncUnban.ts +++ b/src/listeners/track-manual-punishments/modlogSyncUnban.ts @@ -1,4 +1,5 @@ import { BushListener, BushUser, Moderation, ModLogType, type BushClientEvents } from '#lib'; +import { AuditLogEvent } from 'discord-api-types'; import { MessageEmbed, Permissions } from 'discord.js'; export default class ModlogSyncUnbanListener extends BushListener { @@ -22,7 +23,8 @@ export default class ModlogSyncUnbanListener extends BushListener { const now = new Date(); await util.sleep(0.5); // wait for audit log entry - const logs = (await ban.guild.fetchAuditLogs({ type: 'MemberBanRemove' })).entries.filter( + const logs = (await ban.guild.fetchAuditLogs({ type: AuditLogEvent.MemberBanRemove })).entries.filter( + // @ts-ignore: scuffed typings (entry) => entry.target?.id === ban.user.id ); |