diff --git a/src/commands/settings/tickets.ts b/src/commands/settings/tickets.ts
index ee0f2d1..bf4b42a 100644
--- a/src/commands/settings/tickets.ts
+++ b/src/commands/settings/tickets.ts
@@ -10,9 +10,9 @@
     Component,
     ButtonBuilder,
     MessageComponentInteraction,
-    SelectMenuBuilder,
+    StringSelectMenuBuilder,
     Role,
-    SelectMenuInteraction,
+    StringSelectMenuInteraction,
     TextInputComponent,
     ButtonStyle
 } from "discord.js";
@@ -69,10 +69,10 @@
         fetchReply: true
     })) as Message;
     const options = {
-        enabled: interaction.options.getString("enabled")?.startsWith("yes") as boolean | null,
-        category: interaction.options.getChannel("category"),
-        maxtickets: interaction.options.getNumber("maxticketsperuser"),
-        supportping: interaction.options.getRole("supportrole")
+        enabled: (interaction.options.get("enabled")?.value as string).startsWith("yes") as boolean | null,
+        category: interaction.options.get("category")?.channel,
+        maxtickets: interaction.options.get("maxticketsperuser")?.value as number,
+        supportping: interaction.options.get("supportrole")?.role as Role
     };
     if (options.enabled !== null || options.category || options.maxtickets || options.supportping) {
         if (options.category) {
@@ -337,7 +337,7 @@
                     ],
                     components: [
                         new ActionRowBuilder().addComponents([
-                            new SelectMenuBuilder()
+                            new StringSelectMenuBuilder()
                                 .setOptions(
                                     ticketMessages.map(
                                         (
@@ -392,9 +392,9 @@
                     await interaction.channel!.send({
                         embeds: [
                             new EmojiEmbed()
-                                .setTitle(ticketMessages[parseInt((i as SelectMenuInteraction).values[0]!)]!.label)
+                                .setTitle(ticketMessages[parseInt((i as StringSelectMenuInteraction).values[0]!)]!.label)
                                 .setDescription(
-                                    ticketMessages[parseInt((i as SelectMenuInteraction).values[0]!)]!.description
+                                    ticketMessages[parseInt((i as StringSelectMenuInteraction).values[0]!)]!.description
                                 )
                                 .setStatus("Success")
                                 .setEmoji("GUILD.TICKET.OPEN")
@@ -546,7 +546,7 @@
                 components: (customTypes
                     ? [
                           new ActionRowBuilder().addComponents([
-                              new Discord.SelectMenuBuilder()
+                              new Discord.StringSelectMenuBuilder()
                                   .setCustomId("removeTypes")
                                   .setPlaceholder("Select types to remove")
                                   .setMaxValues(customTypes.length)
@@ -585,7 +585,7 @@
             const options = [];
             ticketTypes.forEach((type) => {
                 options.push(
-                    new SelectMenuOption({
+                    new StringSelectMenuOption({
                         label: capitalize(type),
                         value: type,
                         emoji: client.emojis.cache.get(getEmojiByName(`TICKETS.${type.toUpperCase()}`, "id")),
@@ -594,7 +594,7 @@
                 );
             });
             const selectPane = new ActionRowBuilder().addComponents([
-                new Discord.SelectMenuBuilder()
+                new Discord.StringSelectMenuBuilder()
                     .addOptions(options)
                     .setCustomId("types")
                     .setMaxValues(ticketTypes.length)
diff --git a/src/events/guildMemberUpdate.ts b/src/events/guildMemberUpdate.ts
index 440d786..e30fc35 100644
--- a/src/events/guildMemberUpdate.ts
+++ b/src/events/guildMemberUpdate.ts
@@ -6,15 +6,15 @@
 export async function callback(client: NucleusClient, before: GuildMember, after: GuildMember) {
     try {
         const { log, NucleusColors, entry, renderUser, renderDelta, getAuditLog } = client.logger;
-        const auditLog = await getAuditLog(after.guild, AuditLogEvent.MemberUpdate);
-        const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === after.id).first();
-        if (audit.executor.id === client.user!.id) return;
+        const auditLog = (await getAuditLog(after.guild, AuditLogEvent.EmojiCreate))
+        .filter((entry: GuildAuditLogsEntry) => (entry.target as GuildMember)!.id === after.id)[0]!;
+        if (auditLog.executor!.id === client.user!.id) return;
         if (before.nickname !== after.nickname) {
             await client.database.history.create(
                 "nickname",
                 after.guild.id,
                 after.user,
-                audit.executor,
+                auditLog.executor,
                 null,
                 before.nickname ?? before.user.username,
                 after.nickname ?? after.user.username
@@ -34,7 +34,7 @@
                     before: entry(before.nickname, before.nickname ? before.nickname : "*None*"),
                     after: entry(after.nickname, after.nickname ? after.nickname : "*None*"),
                     changed: entry(new Date().getTime(), renderDelta(new Date().getTime())),
-                    changedBy: entry(audit.executor.id, renderUser(audit.executor))
+                    changedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!))
                 },
                 hidden: {
                     guild: after.guild.id
@@ -49,8 +49,8 @@
                 "mute",
                 after.guild.id,
                 after.user,
-                audit.executor,
-                audit.reason,
+                auditLog.executor,
+                auditLog.reason,
                 null,
                 null,
                 null
@@ -69,18 +69,18 @@
                     name: entry(after.user.id, renderUser(after.user)),
                     mutedUntil: entry(
                         after.communicationDisabledUntilTimestamp,
-                        renderDelta(after.communicationDisabledUntilTimestamp)
+                        renderDelta(after.communicationDisabledUntilTimestamp!)
                     ),
                     muted: entry(new Date().getTime(), renderDelta(new Date().getTime())),
-                    mutedBy: entry(audit.executor.id, renderUser(audit.executor)),
-                    reason: entry(audit.reason, audit.reason ? audit.reason : "\n> *No reason provided*")
+                    mutedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
+                    reason: entry(auditLog.reason, auditLog.reason ? auditLog.reason : "\n> *No reason provided*")
                 },
                 hidden: {
                     guild: after.guild.id
                 }
             };
             log(data);
-            client.database.eventScheduler.schedule("naturalUnmute", after.communicationDisabledUntil, {
+            client.database.eventScheduler.schedule("naturalUnmute", after.communicationDisabledUntil?.toISOString()!, {
                 guild: after.guild.id,
                 user: after.id,
                 expires: after.communicationDisabledUntilTimestamp
@@ -88,13 +88,13 @@
         } else if (
             after.communicationDisabledUntil === null &&
             before.communicationDisabledUntilTimestamp !== null &&
-            new Date().getTime() >= audit.createdTimestamp
+            new Date().getTime() >= auditLog.createdTimestamp
         ) {
             await client.database.history.create(
                 "unmute",
                 after.guild.id,
                 after.user,
-                audit.executor,
+                auditLog.executor,
                 null,
                 null,
                 null,
@@ -113,7 +113,7 @@
                     memberId: entry(after.id, `\`${after.id}\``),
                     name: entry(after.user.id, renderUser(after.user)),
                     unmuted: entry(new Date().getTime(), renderDelta(new Date().getTime())),
-                    unmutedBy: entry(audit.executor.id, renderUser(audit.executor))
+                    unmutedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!))
                 },
                 hidden: {
                     guild: after.guild.id
diff --git a/src/events/guildUpdate.ts b/src/events/guildUpdate.ts
index eefab4b..8690af2 100644
--- a/src/events/guildUpdate.ts
+++ b/src/events/guildUpdate.ts
@@ -1,66 +1,67 @@
 import type { NucleusClient } from "../utils/client.js";
-import type { Guild, GuildAuditLogsEntry } from "discord.js";
+import { AuditLogEvent, Guild, GuildAuditLogsEntry } from "discord.js";
 import { callback as statsChannelUpdate } from "../reflex/statsChannelUpdate.js";
 
 export const event = "guildUpdate";
 
 export async function callback(client: NucleusClient, before: Guild, after: Guild) {
-    await statsChannelUpdate(client, after.me!);
+    await statsChannelUpdate(client, after.members.me!);
     const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
-    const auditLog = await getAuditLog(after, "GUILD_UPDATE");
-    const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === after.id).first();
-    if (audit.executor.id === client.user.id) return;
+    const auditLog = (await getAuditLog(after, AuditLogEvent.GuildUpdate))
+        .filter((entry: GuildAuditLogsEntry) => (entry.target as Guild)!.id === after.id)[0]!;
+    if (auditLog.executor!.id === client.user!.id) return;
     const list: Record<string, ReturnType<typeof entry>> = {};
 
-    const verificationLevels = {
-        NONE: "Unrestricted",
-        LOW: "Verified email",
-        MEDIUM: "Registered (5 minutes)",
-        HIGH: "Member (10 minutes)",
-        VERY_HIGH: "Verified phone"
-    };
+    const verificationLevels = [
+        "Unrestricted",
+        "Verified email",
+        "Registered (5 minutes)",
+        "Member (10 minutes)",
+        "Verified phone"
+    ];
 
-    const explicitContentFilterLevels = {
-        DISABLED: "Disabled",
-        MEMBERS_WITHOUT_ROLES: "Members without roles",
-        ALL_MEMBERS: "All members"
-    };
+    const explicitContentFilterLevels = [
+        "Disabled",
+        "Members without roles",
+        "All members"
+    ];
 
-    const MFALevels = {
-        NONE: "None",
-        ELEVATED: "Enabled"
-    };
+    const MFALevels = [
+        "None",
+        "Enabled"
+    ];
+
     const beforeOwner = await before.fetchOwner();
     const afterOwner = await after.fetchOwner();
 
     if (before.name !== after.name) list["name"] = entry([before.name, after.name], `${before.name} -> ${after.name}`);
     if (before.icon !== after.icon)
-        list["icon"] = entry([before.icon, after.icon], `[Before](${before.iconURL()}) -> [After](${after.iconURL()})`);
+        list["icon"] = entry([before.icon!, after.icon!], `[Before](${before.iconURL()}) -> [After](${after.iconURL()})`);
     if (before.splash !== after.splash)
         list["splash"] = entry(
-            [before.splash, after.splash],
+            [before.splash!, after.splash!],
             `[Before](${before.splashURL()}) -> [After](${after.splashURL()})`
         );
     if (before.banner !== after.banner)
         list["banner"] = entry(
-            [before.banner, after.banner],
+            [before.banner!, after.banner!],
             `[Before](${before.bannerURL()}) -> [After](${after.bannerURL()})`
         );
     if (beforeOwner !== afterOwner)
         list["owner"] = entry(
-            [beforeOwner, afterOwner],
+            [beforeOwner.id, afterOwner.id],
             `${renderUser(beforeOwner.user)} -> ${renderUser(afterOwner.user)}`
         );
     if (before.verificationLevel !== after.verificationLevel)
         list["verificationLevel"] = entry(
-            [verificationLevels[before.verificationLevel], verificationLevels[after.verificationLevel]],
-            `${verificationLevels[before.verificationLevel]} -> ${verificationLevels[after.verificationLevel]}`
+            [verificationLevels[before.verificationLevel.valueOf()]!, verificationLevels[before.verificationLevel.valueOf()]!],
+            `${verificationLevels[before.verificationLevel.valueOf()]} -> ${verificationLevels[before.verificationLevel.valueOf()]}`
         );
     if (before.explicitContentFilter !== after.explicitContentFilter)
         list["explicitContentFilter"] = entry(
             [
-                explicitContentFilterLevels[before.explicitContentFilter],
-                explicitContentFilterLevels[after.explicitContentFilter]
+                explicitContentFilterLevels[before.explicitContentFilter.valueOf()]!,
+                explicitContentFilterLevels[after.explicitContentFilter.valueOf()]!
             ],
             `${explicitContentFilterLevels[before.explicitContentFilter]} -> ${
                 explicitContentFilterLevels[after.explicitContentFilter]
@@ -68,13 +69,13 @@
         );
     if (before.mfaLevel !== after.mfaLevel)
         list["2 factor authentication"] = entry(
-            [MFALevels[before.mfaLevel], MFALevels[after.mfaLevel]],
-            `${MFALevels[before.mfaLevel]} -> ${MFALevels[after.mfaLevel]}`
+            [MFALevels[before.mfaLevel.valueOf()]!, MFALevels[after.mfaLevel.valueOf()]!],
+            `${MFALevels[before.mfaLevel.valueOf()]} -> ${MFALevels[after.mfaLevel.valueOf()]}`
         );
 
     if (!Object.keys(list).length) return;
     list["updated"] = entry(new Date().getTime(), renderDelta(new Date().getTime()));
-    list["updatedBy"] = entry(audit.executor.id, renderUser(audit.executor));
+    list["updatedBy"] = entry(auditLog.executor!.id, renderUser(auditLog.executor!));
     const data = {
         meta: {
             type: "guildUpdate",
diff --git a/src/events/inviteCreate.ts b/src/events/inviteCreate.ts
index 7dbf8a7..a267f09 100644
--- a/src/events/inviteCreate.ts
+++ b/src/events/inviteCreate.ts
@@ -1,4 +1,4 @@
-import type { GuildAuditLogsEntry, Invite } from "discord.js";
+import { AuditLogEvent, Guild, GuildAuditLogsEntry, GuildChannel, Invite } from "discord.js";
 // @ts-expect-error
 import humanizeDuration from "humanize-duration";
 import type { NucleusClient } from "../utils/client.js";
@@ -6,12 +6,11 @@
 export const event = "inviteCreate";
 
 export async function callback(client: NucleusClient, invite: Invite) {
+    if(!invite.guild) return; // This is a DM invite (not a guild invite
     const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = client.logger;
-    const auditLog = await getAuditLog(invite.guild, "INVITE_CREATE");
-    const audit = auditLog.entries
-        .filter((entry: GuildAuditLogsEntry) => entry.target!.id === invite.inviterId)
-        .first();
-    if (audit.executor.id === client.user.id) return;
+    const auditLog = (await getAuditLog(invite.guild as Guild, AuditLogEvent.InviteCreate))
+        .filter((entry: GuildAuditLogsEntry) => (entry.target as Invite)!.code === invite.code)[0]!;
+    if (auditLog.executor!.id === client.user!.id) return;
     const data = {
         meta: {
             type: "inviteCreate",
@@ -22,11 +21,11 @@
             timestamp: invite.createdTimestamp
         },
         list: {
-            channel: entry(invite.channel.id, renderChannel(invite.channel)),
+            channel: entry(invite.channel!.id, renderChannel(invite.channel as GuildChannel)),
             link: entry(invite.url, invite.url),
             expires: entry(invite.maxAge, invite.maxAge ? humanizeDuration(invite.maxAge * 1000) : "Never"),
-            createdBy: entry(audit.executor.id, renderUser(audit.executor)),
-            created: entry(invite.createdTimestamp, renderDelta(invite.createdTimestamp))
+            createdBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
+            created: entry(invite.createdTimestamp, renderDelta(invite.createdTimestamp!))
         },
         hidden: {
             guild: invite.guild!.id
diff --git a/src/events/inviteDelete.ts b/src/events/inviteDelete.ts
index e74ad15..1ded432 100644
--- a/src/events/inviteDelete.ts
+++ b/src/events/inviteDelete.ts
@@ -1,4 +1,4 @@
-import type { GuildAuditLogsEntry, Invite } from "discord.js";
+import { AuditLogEvent, Guild, GuildAuditLogsEntry, GuildChannel, Invite } from "discord.js";
 // @ts-expect-error
 import humanizeDuration from "humanize-duration";
 import type { NucleusClient } from "../utils/client.js";
@@ -6,12 +6,11 @@
 export const event = "inviteDelete";
 
 export async function callback(client: NucleusClient, invite: Invite) {
+    if(!invite.guild) return; // This is a DM invite (not a guild invite
     const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = client.logger;
-    const auditLog = await getAuditLog(invite.guild, "INVITE_DELETE");
-    const audit = auditLog.entries
-        .filter((entry: GuildAuditLogsEntry) => entry.target!.id === invite.inviterId)
-        .first();
-    if (audit.executor.id === client.user.id) return;
+    const auditLog = (await getAuditLog(invite.guild as Guild, AuditLogEvent.InviteDelete))
+        .filter((entry: GuildAuditLogsEntry) => (entry.target as Invite)!.code === invite.code)[0]!;
+    if (auditLog.executor!.id === client.user!.id) return;
     const data = {
         meta: {
             type: "inviteDelete",
@@ -22,10 +21,10 @@
             timestamp: new Date().getTime()
         },
         list: {
-            channel: entry(invite.channel.id, renderChannel(invite.channel)),
+            channel: entry(invite.channel!.id, renderChannel(invite.channel as GuildChannel)),
             link: entry(invite.url, invite.url),
             expires: entry(invite.maxAge, invite.maxAge ? humanizeDuration(invite.maxAge * 1000) : "Never"),
-            deletedBy: entry(audit.executor.id, renderUser(audit.executor)),
+            deletedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
             deleted: entry(new Date().getTime(), renderDelta(new Date().getTime()))
         },
         hidden: {
diff --git a/src/events/memberJoin.ts b/src/events/memberJoin.ts
index 93c9186..daf195a 100644
--- a/src/events/memberJoin.ts
+++ b/src/events/memberJoin.ts
@@ -22,8 +22,8 @@
         list: {
             memberId: entry(member.id, `\`${member.id}\``),
             name: entry(member.id, renderUser(member.user)),
-            joined: entry(member.joinedAt, renderDelta(member.joinedAt)),
-            accountCreated: entry(member.user.createdAt, renderDelta(member.user.createdAt)),
+            joined: entry(member.joinedTimestamp, renderDelta(member.joinedTimestamp?.valueOf()!)),
+            accountCreated: entry(member.user.createdTimestamp, renderDelta(member.user.createdTimestamp.valueOf()!)),
             serverMemberCount: member.guild.memberCount
         },
         hidden: {
diff --git a/src/events/memberLeave.ts b/src/events/memberLeave.ts
index 4731d58..936f8c2 100644
--- a/src/events/memberLeave.ts
+++ b/src/events/memberLeave.ts
@@ -1,4 +1,4 @@
-import type { GuildAuditLogsEntry, GuildMember } from "discord.js";
+import { AuditLogEvent, Guild, GuildAuditLogsEntry, GuildMember } from "discord.js";
 import type { NucleusClient } from "../utils/client.js";
 
 import { purgeByUser } from "../actions/tickets/delete.js";
@@ -7,21 +7,21 @@
 export const event = "guildMemberRemove";
 
 export async function callback(client: NucleusClient, member: GuildMember) {
-    purgeByUser(member.id, member.guild);
+    purgeByUser(member.id, member.guild.id);
     await statsChannelRemove(client, member);
     const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
-    const auditLog = await getAuditLog(member.guild, "MEMBER_KICK");
-    const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === member.id).first();
+    const auditLog = (await getAuditLog(member.guild as Guild, AuditLogEvent.MemberKick))
+        .filter((entry: GuildAuditLogsEntry) => (entry.target as GuildMember)!.id === member.id)[0]!;
     let type = "leave";
-    if (audit) {
-        if (audit.executor.id === client.user.id) return;
-        if (audit.createdAt - 100 >= new Date().getTime()) {
+    if (auditLog) {
+        if (auditLog.executor!.id === client.user!.id) return;
+        if (auditLog.createdAt.valueOf() - 100 >= new Date().getTime()) {
             type = "kick";
         }
     }
     let data;
     if (type === "kick") {
-        await client.database.history.create("kick", member.guild.id, member.user, audit.executor, audit.reason);
+        await client.database.history.create("kick", member.guild.id, member.user, auditLog.executor, auditLog.reason);
         data = {
             meta: {
                 type: "memberKick",
@@ -34,11 +34,11 @@
             list: {
                 memberId: entry(member.id, `\`${member.id}\``),
                 name: entry(member.id, renderUser(member.user)),
-                joined: entry(member.joinedAt, renderDelta(member.joinedAt)),
+                joined: entry(member.joinedTimestamp, renderDelta(member.joinedTimestamp?.valueOf()!)),
                 kicked: entry(new Date().getTime(), renderDelta(new Date().getTime())),
-                kickedBy: entry(audit.executor.id, renderUser(audit.executor)),
-                reason: entry(audit.reason, audit.reason ? `\n> ${audit.reason}` : "*No reason provided.*"),
-                accountCreated: entry(member.user.createdAt, renderDelta(member.user.createdAt)),
+                kickedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
+                reason: entry(auditLog.reason, auditLog.reason ? `\n> ${auditLog.reason}` : "*No reason provided.*"),
+                accountCreated: entry(member.user.createdTimestamp, renderDelta(member.user.createdTimestamp)),
                 serverMemberCount: member.guild.memberCount
             },
             hidden: {
@@ -59,9 +59,9 @@
             list: {
                 memberId: entry(member.id, `\`${member.id}\``),
                 name: entry(member.id, renderUser(member.user)),
-                joined: entry(member.joinedTimestamp, renderDelta(member.joinedAt)),
+                joined: entry(member.joinedTimestamp, renderDelta(member.joinedTimestamp?.valueOf()!)),
                 left: entry(new Date().getTime(), renderDelta(new Date().getTime())),
-                accountCreated: entry(member.user.createdAt, renderDelta(member.user.createdAt)),
+                accountCreated: entry(member.user.createdTimestamp, renderDelta(member.user.createdTimestamp)),
                 serverMemberCount: member.guild.memberCount
             },
             hidden: {
diff --git a/src/events/roleCreate.ts b/src/events/roleCreate.ts
index 25e9c98..d253ce7 100644
--- a/src/events/roleCreate.ts
+++ b/src/events/roleCreate.ts
@@ -1,14 +1,14 @@
 import type { NucleusClient } from "../utils/client.js";
-import type { GuildAuditLogsEntry, Role } from "discord.js";
+import { AuditLogEvent, Guild, GuildAuditLogsEntry, Role } from "discord.js";
 
 export const event = "roleCreate";
 
 export async function callback(client: NucleusClient, role: Role) {
     const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderRole } = client.logger;
     if (role.managed) return;
-    const auditLog = await getAuditLog(role.guild, "ROLE_CREATE");
-    const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === role.id).first();
-    if (audit.executor.id === client.user.id) return;
+    const auditLog = (await getAuditLog(role.guild as Guild, AuditLogEvent.RoleCreate))
+        .filter((entry: GuildAuditLogsEntry) => (entry.target as Role)!.id === role.id)[0]!;
+    if (auditLog.executor!.id === client.user!.id) return;
     const data = {
         meta: {
             type: "roleCreate",
@@ -21,7 +21,7 @@
         list: {
             roleId: entry(role.id, `\`${role.id}\``),
             role: entry(role.name, renderRole(role)),
-            createdBy: entry(audit.executor.id, renderUser(audit.executor)),
+            createdBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
             created: entry(role.createdTimestamp, renderDelta(role.createdTimestamp))
         },
         hidden: {
diff --git a/src/events/roleDelete.ts b/src/events/roleDelete.ts
index 4c89565..f41241b 100644
--- a/src/events/roleDelete.ts
+++ b/src/events/roleDelete.ts
@@ -1,15 +1,15 @@
 import getEmojiByName from "../utils/getEmojiByName.js";
 import type { NucleusClient } from "../utils/client.js";
-import type { GuildAuditLogsEntry, Role } from "discord.js";
+import { AuditLogEvent, Guild, GuildAuditLogsEntry, Role } from "discord.js";
 
 export const event = "roleDelete";
 
 export async function callback(client: NucleusClient, role: Role) {
     const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
     if (role.managed) return;
-    const auditLog = await getAuditLog(role.guild, "ROLE_DELETE");
-    const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === role.id).first();
-    if (audit.executor.id === client.user.id) return;
+    const auditLog = (await getAuditLog(role.guild as Guild, AuditLogEvent.RoleDelete))
+        .filter((entry: GuildAuditLogsEntry) => (entry.target as Role)!.id === role.id)[0]!;
+    if (auditLog.executor!.id === client.user!.id) return;
     const data = {
         meta: {
             type: "roleDelete",
@@ -17,7 +17,7 @@
             calculateType: "guildRoleUpdate",
             color: NucleusColors.red,
             emoji: "GUILD.ROLES.DELETE",
-            timestamp: audit.createdTimestamp
+            timestamp: auditLog.createdTimestamp
         },
         list: {
             roleId: entry(role.id, `\`${role.id}\``),
@@ -32,7 +32,7 @@
                 role.mentionable ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`
             ),
             members: entry(role.members.size, `${role.members.size}`),
-            deletedBy: entry(audit.executor.id, renderUser(audit.executor)),
+            deletedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
             created: entry(role.createdTimestamp, renderDelta(role.createdTimestamp)),
             deleted: entry(new Date().getTime(), renderDelta(new Date().getTime()))
         },
diff --git a/src/events/roleUpdate.ts b/src/events/roleUpdate.ts
index fc26d6c..924ec3e 100644
--- a/src/events/roleUpdate.ts
+++ b/src/events/roleUpdate.ts
@@ -1,36 +1,36 @@
-import type { Role } from "discord.js";
+import { AuditLogEvent, Guild, GuildAuditLogsEntry, Role } from "discord.js";
 import type { NucleusClient } from "../utils/client.js";
 import getEmojiByName from "../utils/getEmojiByName.js";
 
 export const event = "roleUpdate";
 
-export async function callback(client: NucleusClient, or: Role, nr: Role) {
+export async function callback(client: NucleusClient, oldRole: Role, newRole: Role) {
     const { getAuditLog, log, NucleusColors, entry, renderDelta, renderUser, renderRole } = client.logger;
 
-    const auditLog = await getAuditLog(nr.guild, "ROLE_UPDATE");
-    const audit = auditLog.entries.first();
-    if (audit.executor.id === client.user.id) return;
+    const auditLog = (await getAuditLog(newRole.guild as Guild, AuditLogEvent.RoleUpdate))
+        .filter((entry: GuildAuditLogsEntry) => (entry.target as Role)!.id === newRole.id)[0]!;
+    if (auditLog.executor!.id === client.user!.id) return;
 
     const changes: Record<string, ReturnType<typeof entry>> = {
-        roleId: entry(nr.id, `\`${nr.id}\``),
-        role: entry(nr.id, renderRole(nr)),
+        roleId: entry(newRole.id, `\`${newRole.id}\``),
+        role: entry(newRole.id, renderRole(newRole)),
         edited: entry(new Date().getTime(), renderDelta(new Date().getTime())),
-        editedBy: entry(audit.executor.id, renderUser((await nr.guild.members.fetch(audit.executor.id)).user))
+        editedBy: entry(auditLog.executor!.id, renderUser((await newRole.guild.members.fetch(auditLog.executor!.id)).user))
     };
     const mentionable = ["", ""];
     const hoist = ["", ""];
-    mentionable[0] = or.mentionable ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
-    mentionable[1] = nr.mentionable ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
-    hoist[0] = or.hoist ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
-    hoist[1] = nr.hoist ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
-    if (or.name !== nr.name) changes["name"] = entry([or.name, nr.name], `${or.name} -> ${nr.name}`);
-    if (or.position !== nr.position)
-        changes["position"] = entry([or.position, nr.position], `${or.position} -> ${nr.position}`);
-    if (or.hoist !== nr.hoist) changes["showInMemberList"] = entry([or.hoist, nr.hoist], `${hoist[0]} -> ${hoist[1]}`);
-    if (or.mentionable !== nr.mentionable)
-        changes["mentionable"] = entry([or.mentionable, nr.mentionable], `${mentionable[0]} -> ${mentionable[1]}`);
-    if (or.hexColor !== nr.hexColor)
-        changes["color"] = entry([or.hexColor, nr.hexColor], `\`${or.hexColor}\` -> \`${nr.hexColor}\``);
+    mentionable[0] = oldRole.mentionable ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
+    mentionable[1] = newRole.mentionable ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
+    hoist[0] = oldRole.hoist ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
+    hoist[1] = newRole.hoist ? `${getEmojiByName("CONTROL.TICK")} Yes` : `${getEmojiByName("CONTROL.CROSS")} No`;
+    if (oldRole.name !== newRole.name) changes["name"] = entry([oldRole.name, newRole.name], `${oldRole.name} -> ${newRole.name}`);
+    if (oldRole.position !== newRole.position)
+        changes["position"] = entry([oldRole.position.toString(), newRole.position.toString()], `${oldRole.position} -> ${newRole.position}`);
+    if (oldRole.hoist !== newRole.hoist) changes["showInMemberList"] = entry([oldRole.hoist, newRole.hoist], `${hoist[0]} -> ${hoist[1]}`);
+    if (oldRole.mentionable !== newRole.mentionable)
+        changes["mentionable"] = entry([oldRole.mentionable, newRole.mentionable], `${mentionable[0]} -> ${mentionable[1]}`);
+    if (oldRole.hexColor !== newRole.hexColor)
+        changes["color"] = entry([oldRole.hexColor, newRole.hexColor], `\`${oldRole.hexColor}\` -> \`${newRole.hexColor}\``);
 
     if (Object.keys(changes).length === 4) return;
 
@@ -41,11 +41,11 @@
             calculateType: "guildRoleUpdate",
             color: NucleusColors.yellow,
             emoji: "GUILD.ROLES.EDIT",
-            timestamp: audit.createdTimestamp
+            timestamp: auditLog.createdTimestamp
         },
         list: changes,
         hidden: {
-            guild: nr.guild.id
+            guild: newRole.guild.id
         }
     }; // TODO: show perms changed (webpage)
     log(data);
diff --git a/src/events/stickerCreate.ts b/src/events/stickerCreate.ts
index 295d48b..7dcaf5a 100644
--- a/src/events/stickerCreate.ts
+++ b/src/events/stickerCreate.ts
@@ -1,13 +1,13 @@
 import type { NucleusClient } from "../utils/client.js";
-import type { GuildAuditLogsEntry, Sticker } from "discord.js";
+import { AuditLogEvent, GuildAuditLogsEntry, Sticker } from "discord.js";
 
 export const event = "stickerDelete";
 
-export async function callback(client: NucleusClient, emoji: Sticker) {
+export async function callback(client: NucleusClient, sticker: Sticker) {
     const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
-    const auditLog = await getAuditLog(emoji.guild, "STICKER_CREATE");
-    const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === emoji.id).first();
-    if (audit.executor.id === client.user.id) return;
+    const auditLog = (await getAuditLog(sticker.guild!, AuditLogEvent.EmojiCreate))
+        .filter((entry: GuildAuditLogsEntry) => (entry.target as Sticker)!.id === sticker.id)[0] as GuildAuditLogsEntry;
+    if (auditLog.executor!.id === client.user!.id) return;
     const data = {
         meta: {
             type: "stickerCreate",
@@ -15,16 +15,16 @@
             calculateType: "stickerUpdate",
             color: NucleusColors.green,
             emoji: "GUILD.EMOJI.CREATE",
-            timestamp: emoji.createdTimestamp
+            timestamp: sticker.createdTimestamp
         },
         list: {
-            stickerId: entry(emoji.id, `\`${emoji.id}\``),
-            emoji: entry(emoji.name, `\`:${emoji.name}:\``),
-            createdBy: entry(audit.executor.id, renderUser(audit.executor)),
-            created: entry(emoji.createdTimestamp, renderDelta(emoji.createdTimestamp))
+            stickerId: entry(sticker.id, `\`${sticker.id}\``),
+            emoji: entry(sticker.name, `\`:${sticker.name}:\``),
+            createdBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
+            created: entry(sticker.createdTimestamp, renderDelta(sticker.createdTimestamp))
         },
         hidden: {
-            guild: emoji.guild!.id
+            guild: sticker.guild!.id
         }
     };
     log(data);
diff --git a/src/events/stickerDelete.ts b/src/events/stickerDelete.ts
index fed99e6..3f1b741 100644
--- a/src/events/stickerDelete.ts
+++ b/src/events/stickerDelete.ts
@@ -1,31 +1,31 @@
 import type { NucleusClient } from "../utils/client.js";
-import type { GuildAuditLogsEntry, Sticker } from "discord.js";
+import { AuditLogEvent, GuildAuditLogsEntry, Sticker } from "discord.js";
 
 export const event = "stickerDelete";
 
-export async function callback(client: NucleusClient, emoji: Sticker) {
+export async function callback(client: NucleusClient, sticker: Sticker) {
     const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
-    const auditLog = await getAuditLog(emoji.guild, "STICKER_DELETE");
-    const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === emoji.id).first();
-    if (audit.executor.id === client.user.id) return;
+    const auditLog = (await getAuditLog(sticker.guild!, AuditLogEvent.StickerDelete))
+        .filter((entry: GuildAuditLogsEntry) => (entry.target as Sticker)!.id === sticker.id)[0] as GuildAuditLogsEntry;
+    if (auditLog.executor!.id === client.user!.id) return;
     const data = {
         meta: {
             type: "stickerDelete",
             displayName: "Sticker Deleted",
             calculateType: "stickerUpdate",
             color: NucleusColors.red,
-            emoji: "GUILD.EMOJI.DELETE",
-            timestamp: audit.createdTimestamp
+            sticker: "GUILD.sticker.DELETE",
+            timestamp: auditLog.createdTimestamp
         },
         list: {
-            stickerId: entry(emoji.id, `\`${emoji.id}\``),
-            sticker: entry(emoji.name, `\`${emoji.name}\``),
-            deletedBy: entry(audit.executor.id, renderUser(audit.executor)),
-            created: entry(emoji.createdTimestamp, renderDelta(emoji.createdTimestamp)),
-            deleted: entry(audit.createdTimestamp, renderDelta(audit.createdTimestamp))
+            stickerId: entry(sticker.id, `\`${sticker.id}\``),
+            sticker: entry(sticker.name, `\`${sticker.name}\``),
+            deletedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
+            created: entry(sticker.createdTimestamp, renderDelta(sticker.createdTimestamp)),
+            deleted: entry(auditLog.createdTimestamp, renderDelta(auditLog.createdTimestamp))
         },
         hidden: {
-            guild: emoji.guild!.id
+            guild: sticker.guild!.id
         }
     };
     log(data);
diff --git a/src/events/stickerUpdate.ts b/src/events/stickerUpdate.ts
index 0ac000e..cc11726 100644
--- a/src/events/stickerUpdate.ts
+++ b/src/events/stickerUpdate.ts
@@ -1,21 +1,21 @@
 import type { NucleusClient } from "../utils/client.js";
-import type { Sticker } from "discord.js";
+import { AuditLogEvent, GuildAuditLogsEntry, Sticker } from "discord.js";
 
 export const event = "stickerUpdate";
 
-export async function callback(client: NucleusClient, oe: Sticker, ne: Sticker) {
+export async function callback(client: NucleusClient, oldSticker: Sticker, newSticker: Sticker) {
     const { getAuditLog, log, NucleusColors, entry, renderDelta, renderUser } = client.logger;
 
-    if (oe.name === ne.name) return;
-    const auditLog = await getAuditLog(ne.guild, "STICKER_UPDATE");
-    const audit = auditLog.entries.first();
-    if (audit.executor.id === client.user.id) return;
+    if (oldSticker.name === newSticker.name) return;
+    const auditLog = (await getAuditLog(newSticker.guild!, AuditLogEvent.StickerUpdate))
+        .filter((entry: GuildAuditLogsEntry) => (entry.target as Sticker)!.id === newSticker.id)[0] as GuildAuditLogsEntry;
+    if (auditLog.executor!.id === client.user!.id) return;
 
     const changes = {
-        stickerId: entry(ne.id, `\`${ne.id}\``),
-        edited: entry(ne.createdTimestamp, renderDelta(ne.createdTimestamp)),
-        editedBy: entry(audit.executor.id, renderUser((await ne.guild!.members.fetch(audit.executor.id)).user)),
-        name: entry([oe.name, ne.name], `\`:${oe.name}:\` -> \`:${ne.name}:\``)
+        stickerId: entry(newSticker.id, `\`${newSticker.id}\``),
+        edited: entry(newSticker.createdTimestamp, renderDelta(newSticker.createdTimestamp)),
+        editedBy: entry(auditLog.executor!.id, renderUser((await newSticker.guild!.members.fetch(auditLog.executor!.id)).user)),
+        name: entry([oldSticker.name, newSticker.name], `\`:${oldSticker.name}:\` -> \`:${newSticker.name}:\``)
     };
     const data = {
         meta: {
@@ -24,11 +24,11 @@
             calculateType: "stickerUpdate",
             color: NucleusColors.yellow,
             emoji: "GUILD.EMOJI.EDIT",
-            timestamp: audit.createdTimestamp
+            timestamp: auditLog.createdTimestamp
         },
         list: changes,
         hidden: {
-            guild: ne.guild!.id
+            guild: newSticker.guild!.id
         }
     };
     log(data);
diff --git a/src/events/threadCreate.ts b/src/events/threadCreate.ts
index 1f1b758..14516b3 100644
--- a/src/events/threadCreate.ts
+++ b/src/events/threadCreate.ts
@@ -1,4 +1,4 @@
-import type { GuildAuditLogsEntry, ThreadChannel } from "discord.js";
+import { AuditLogEvent, GuildAuditLogsEntry, ThreadChannel } from "discord.js";
 // @ts-expect-error
 import humanizeDuration from "humanize-duration";
 import type { NucleusClient } from "../utils/client.js";
@@ -6,9 +6,9 @@
 
 export async function callback(client: NucleusClient, thread: ThreadChannel) {
     const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = client.logger;
-    const auditLog = await getAuditLog(thread.guild, "THREAD_CREATE");
-    const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === thread.id).first();
-    if (audit.executor.id === client.user.id) return;
+    const auditLog = (await getAuditLog(thread.guild, AuditLogEvent.ThreadCreate))
+        .filter((entry: GuildAuditLogsEntry) => (entry.target as ThreadChannel)!.id === thread.id)[0] as GuildAuditLogsEntry;
+    if (auditLog.executor!.id === client.user!.id) return;
     const category = thread.parent
         ? entry(
               thread.parent.parent ? thread.parent.parent.name : "None",
@@ -27,7 +27,7 @@
         list: {
             threadId: entry(thread.id, `\`${thread.id}\``),
             name: entry(thread.name, renderChannel(thread)),
-            parentChannel: entry(thread.parentId, renderChannel(thread.parent)),
+            parentChannel: entry(thread.parentId, renderChannel(thread.parent!)),
             category: category,
             autoArchiveDuration: entry(
                 thread.autoArchiveDuration,
@@ -35,8 +35,8 @@
                     round: true
                 })
             ),
-            createdBy: entry(audit.executor.id, renderUser(audit.executor)),
-            created: entry(thread.createdTimestamp, renderDelta(thread.createdTimestamp))
+            createdBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
+            created: entry(thread.createdTimestamp, renderDelta(thread.createdTimestamp!))
         },
         hidden: {
             guild: thread.guild.id
diff --git a/src/events/threadDelete.ts b/src/events/threadDelete.ts
index cdc89ee..1957e80 100644
--- a/src/events/threadDelete.ts
+++ b/src/events/threadDelete.ts
@@ -1,4 +1,4 @@
-import type { GuildAuditLogsEntry, ThreadChannel } from "discord.js";
+import { AuditLogEvent, GuildAuditLogsEntry, ThreadChannel } from "discord.js";
 // @ts-expect-error
 import humanizeDuration from "humanize-duration";
 import type { NucleusClient } from "../utils/client.js";
@@ -6,9 +6,9 @@
 
 export async function callback(client: NucleusClient, thread: ThreadChannel) {
     const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = client.logger;
-    const auditLog = await getAuditLog(thread.guild, "THREAD_UPDATE");
-    const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === thread.id).first();
-    if (audit.executor.id === client.user.id) return;
+    const auditLog = (await getAuditLog(thread.guild, AuditLogEvent.ThreadDelete))
+        .filter((entry: GuildAuditLogsEntry) => (entry.target as ThreadChannel)!.id === thread.id)[0] as GuildAuditLogsEntry;
+    if (auditLog.executor!.id === client.user!.id) return;
     const category = thread.parent
         ? entry(
               thread.parent.parent ? thread.parent.parent.name : "None",
@@ -35,9 +35,9 @@
                     round: true
                 })
             ),
-            membersInThread: entry(thread.memberCount, thread.memberCount),
-            deletedBy: entry(audit.executor.id, renderUser(audit.executor)),
-            created: entry(thread.createdTimestamp, renderDelta(thread.createdTimestamp)),
+            membersInThread: entry(thread.memberCount, thread.memberCount!.toString()),
+            deletedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!)),
+            created: entry(thread.createdTimestamp, renderDelta(thread.createdTimestamp!)),
             deleted: entry(new Date().getTime(), renderDelta(new Date().getTime()))
         },
         hidden: {
diff --git a/src/events/threadUpdate.ts b/src/events/threadUpdate.ts
index 9125fcb..bcf73fa 100644
--- a/src/events/threadUpdate.ts
+++ b/src/events/threadUpdate.ts
@@ -1,44 +1,44 @@
-import type { GuildAuditLogsEntry, ThreadChannel } from "discord.js";
+import { AuditLogEvent, GuildAuditLogsEntry, ThreadChannel } from "discord.js";
 // @ts-expect-error
 import humanizeDuration from "humanize-duration";
 import type { NucleusClient } from "../utils/client.js";
 
 export const event = "threadUpdate";
 
-export async function callback(client: NucleusClient, before: ThreadChannel, after: ThreadChannel) {
+export async function callback(client: NucleusClient, oldThread: ThreadChannel, newThread: ThreadChannel) {
     const { getAuditLog, log, NucleusColors, entry, renderUser, renderDelta, renderChannel } = client.logger;
-    const auditLog = await getAuditLog(after.guild, "THREAD_UPDATE");
-    const audit = auditLog.entries.filter((entry: GuildAuditLogsEntry) => entry.target!.id === after.id).first();
-    if (audit.executor.id === client.user.id) return;
+    const auditLog = (await getAuditLog(newThread.guild, AuditLogEvent.ThreadUpdate))
+        .filter((entry: GuildAuditLogsEntry) => (entry.target as ThreadChannel)!.id === newThread.id)[0] as GuildAuditLogsEntry;
+    if (auditLog.executor!.id === client.user!.id) return;
     const list: Record<string, ReturnType<typeof entry>> = {
-        threadId: entry(after.id, `\`${after.id}\``),
-        thread: entry(after.name, renderChannel(after)),
-        parentChannel: entry(after.parentId, renderChannel(after.parent))
+        threadId: entry(newThread.id, `\`${newThread.id}\``),
+        thread: entry(newThread.name, renderChannel(newThread)),
+        parentChannel: entry(newThread.parentId, renderChannel(newThread.parent!))
     };
-    if (before.name !== after.name) {
-        list["name"] = entry([before.name, after.name], `${before.name} -> ${after.name}`);
+    if (oldThread.name !== newThread.name) {
+        list["name"] = entry([oldThread.name, newThread.name], `${oldThread.name} -> ${newThread.name}`);
     }
-    if (before.autoArchiveDuration !== after.autoArchiveDuration) {
+    if (oldThread.autoArchiveDuration !== newThread.autoArchiveDuration) {
         list["autoArchiveDuration"] = entry(
-            [before.autoArchiveDuration, after.autoArchiveDuration],
-            `${humanizeDuration((before.autoArchiveDuration ?? 0) * 60 * 1000, {
+            [oldThread.autoArchiveDuration!.toString(), newThread.autoArchiveDuration!.toString()],
+            `${humanizeDuration((oldThread.autoArchiveDuration ?? 0) * 60 * 1000, {
                 round: true
-            })} -> ${humanizeDuration((after.autoArchiveDuration ?? 0) * 60 * 1000, {
+            })} -> ${humanizeDuration((newThread.autoArchiveDuration ?? 0) * 60 * 1000, {
                 round: true
             })}`
         );
     }
-    if (before.rateLimitPerUser !== after.rateLimitPerUser) {
+    if (oldThread.rateLimitPerUser !== newThread.rateLimitPerUser) {
         list["slowmode"] = entry(
-            [before.rateLimitPerUser, after.rateLimitPerUser],
-            `${humanizeDuration((before.rateLimitPerUser ?? 0) * 1000)} -> ${humanizeDuration(
-                (after.rateLimitPerUser ?? 0) * 1000
+            [oldThread.rateLimitPerUser!.toString(), newThread.rateLimitPerUser!.toString()],
+            `${humanizeDuration((oldThread.rateLimitPerUser ?? 0) * 1000)} -> ${humanizeDuration(
+                (newThread.rateLimitPerUser ?? 0) * 1000
             )}`
         );
     }
     if (!(Object.keys(list).length - 3)) return;
     list["updated"] = entry(new Date().getTime(), renderDelta(new Date().getTime()));
-    list["updatedBy"] = entry(audit.executor.id, renderUser(audit.executor));
+    list["updatedBy"] = entry(auditLog.executor!.id, renderUser(auditLog.executor!));
     const data = {
         meta: {
             type: "channelUpdate",
@@ -50,7 +50,7 @@
         },
         list: list,
         hidden: {
-            guild: after.guild.id
+            guild: newThread.guild.id
         }
     };
     log(data);
diff --git a/src/events/webhookUpdate.ts b/src/events/webhookUpdate.ts
index a991c66..18b6d46 100644
--- a/src/events/webhookUpdate.ts
+++ b/src/events/webhookUpdate.ts
@@ -1,4 +1,4 @@
-import type { GuildAuditLogsEntry, Webhook } from "discord.js";
+import { AuditLogEvent, GuildAuditLogsEntry, Webhook } from "discord.js";
 import type Discord from "discord.js";
 import type { NucleusClient } from "../utils/client.js";
 export const event = "webhookUpdate";
@@ -6,32 +6,13 @@
 export async function callback(client: NucleusClient, channel: Discord.GuildChannel) {
     try {
         const { getAuditLog, log, NucleusColors, entry, renderUser, renderChannel, renderDelta } = client.logger;
-        let auditLogCreate = getAuditLog(channel.guild, "WEBHOOK_CREATE");
-        let auditLogUpdate = getAuditLog(channel.guild, "WEBHOOK_UPDATE");
-        let auditLogDelete = getAuditLog(channel.guild, "WEBHOOK_DELETE");
-        [auditLogCreate, auditLogUpdate, auditLogDelete] = await Promise.all([
-            auditLogCreate,
-            auditLogUpdate,
-            auditLogDelete
-        ]);
-        const auditCreate = auditLogCreate.entries
-            .filter((entry: GuildAuditLogsEntry | null) => {
-                if (entry === null) return false;
-                return (entry.target! as Webhook).channelId === channel.id;
-            })
-            .first();
-        const auditUpdate = auditLogUpdate.entries
-            .filter((entry: GuildAuditLogsEntry | null) => {
-                if (entry === null) return false;
-                return (entry.target! as Webhook).channelId === channel.id;
-            })
-            .first();
-        const auditDelete = auditLogDelete.entries
-            .filter((entry: GuildAuditLogsEntry | null) => {
-                if (entry === null) return false;
-                return (entry.target! as Webhook).channelId === channel.id;
-            })
-            .first();
+        const auditCreate = (await getAuditLog(channel.guild, AuditLogEvent.WebhookCreate))
+            .filter((entry: GuildAuditLogsEntry) => (entry.target as Webhook)!.id === channel.id)[0] as GuildAuditLogsEntry;
+        const auditDelete = (await getAuditLog(channel.guild, AuditLogEvent.WebhookDelete))
+            .filter((entry: GuildAuditLogsEntry) => (entry.target as Webhook)!.id === channel.id)[0] as GuildAuditLogsEntry;
+        const auditUpdate = (await getAuditLog(channel.guild, AuditLogEvent.WebhookUpdate))
+            .filter((entry: GuildAuditLogsEntry) => (entry.target as Webhook)!.id === channel.id)[0] as GuildAuditLogsEntry;
+
         if (!auditCreate && !auditUpdate && !auditDelete) return;
         let audit = auditCreate;
         let action: "Create" | "Update" | "Delete" = "Create";
diff --git a/src/utils/log.ts b/src/utils/log.ts
index d4e2a82..54f656a 100644
--- a/src/utils/log.ts
+++ b/src/utils/log.ts
@@ -25,7 +25,7 @@
         const delta = num2 - num1;
         return `${num1} -> ${num2} (${delta > 0 ? "+" : ""}${delta})`;
     },
-    entry(value: string | number | boolean | null | string[], displayValue: string): { value: string | boolean | null | string[]; displayValue: string } {
+    entry(value: string | number | boolean | null | (string | boolean)[], displayValue: string): { value: string | boolean | null | (string | boolean | number)[]; displayValue: string } {
         if (typeof value === "number") value = value.toString();
         return { value: value, displayValue: displayValue };
     },
