diff --git a/src/commands/help.ts b/src/commands/help.ts
index b6115f9..90ef133 100644
--- a/src/commands/help.ts
+++ b/src/commands/help.ts
@@ -100,7 +100,7 @@
                 nameLocalized?: string;
                 descriptionLocalized?: string;
             })[] = [];
-            //o ptions
+            //options
             if(currentPath[1] !== "" && currentPath[1] !== "none" && currentPath[2] !== "" && currentPath[2] !== "none") {
                 const Op = current.options.find(option => option.name === currentPath[1])! as ApplicationCommandSubGroup
                 const Op2 = Op.options!.find(option => option.name === currentPath[2])!
@@ -114,7 +114,7 @@
                     options = Op.options ?? []
                 }
             } else {
-                options = current.options.filter(option => option.type !== ApplicationCommandOptionType.SubcommandGroup && option.type !== ApplicationCommandOptionType.Subcommand) || [];
+                options = current.options.filter(option => (option.type !== ApplicationCommandOptionType.SubcommandGroup) && (option.type !== ApplicationCommandOptionType.Subcommand));
             }
             for(const option of options) {
                 optionString += `> ${option.name} (${ApplicationCommandOptionType[option.type]})- ${option.description}\n`
@@ -141,7 +141,7 @@
                         ...subcommandGroups.map((option) => new StringSelectMenuOptionBuilder().setLabel(capitalize(option.name)).setValue(option.name).setDefault(currentPath[1] === option.name))
                     )
                 if(subcommandGroupRow.components[0]!.options.find((option) => option.data.default && option.data.value !== "none")) {
-                    const subsubcommands = (subcommandGroups.find((option) => option.name === currentPath[1])! as ApplicationCommandSubGroup).options?.filter((option) => option.type === ApplicationCommandOptionType.Subcommand) ?? [];
+                    const subsubcommands = (subcommandGroups.find((option) => option.name === currentPath[1])! as ApplicationCommandSubGroup).options ?? [];
                     subcommandRow.components[0]!
                         .addOptions(
                             new StringSelectMenuOptionBuilder().setLabel("Select a subcommand").setValue("none").setDefault(currentPath[2] === "none"),
diff --git a/src/commands/nucleus/premium.ts b/src/commands/nucleus/premium.ts
index e0d8d8d..354c303 100644
--- a/src/commands/nucleus/premium.ts
+++ b/src/commands/nucleus/premium.ts
@@ -1,4 +1,4 @@
-import { ActionRowBuilder, ButtonBuilder, ButtonStyle, CommandInteraction } from "discord.js";
+import { ActionRowBuilder, ButtonBuilder, ButtonInteraction, ButtonStyle, CommandInteraction } from "discord.js";
 import type { SlashCommandSubcommandBuilder } from "discord.js";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import client from "../../utils/client.js";
@@ -28,7 +28,7 @@
     const dbMember = await client.database.premium.fetchUser(interaction.user.id)
     let premium = `You do not have premium! You can't activate premium on any servers.`;
     let count = 0;
-    const {level, appliesTo} = dbMember || {level: 0, appliesTo: []}
+    const {level, appliesTo} = dbMember ?? {level: 0, appliesTo: []}
     if (level === 99) {
         premium = `You have Infinite Premium! You have been gifted this by the developers as a thank you. You can give premium to any and all servers you are in.`;
         count = 200;
@@ -48,71 +48,65 @@
         premiumGuild = `\n\n**This server has premium!**`
     }
 
-    let closed = false;
-    do {
+    interaction.editReply({
+        embeds: [
+            new EmojiEmbed()
+                .setTitle("Premium")
+                .setDescription(
+                    premium + firstDescription + premiumGuild
+                )
+                .setEmoji("NUCLEUS.LOGO")
+                .setStatus("Danger")
+        ],
+        components: [
+            new ActionRowBuilder<ButtonBuilder>()
+                .addComponents(
+                    new ButtonBuilder()
+                        .setStyle(ButtonStyle.Primary)
+                        .setLabel("Activate Premium here")
+                        .setCustomId("premiumActivate")
+                        .setDisabled(count <= 0 && hasPremium)
+                )
+        ]
+    });
+
+    const filter = (i: ButtonInteraction) => i.customId === "premiumActivate" && i.user.id === interaction.user.id;
+    let i;
+    try {
+        i = await interaction.channel!.awaitMessageComponent<2>({ filter, time: 60000 });
+    } catch (e) {
+        return;
+    }
+    i.deferUpdate();
+    const guild = i.guild!;
+    if (count - appliesTo.length <= 0) {
         interaction.editReply({
             embeds: [
                 new EmojiEmbed()
                     .setTitle("Premium")
                     .setDescription(
-                        premium + firstDescription + premiumGuild
+                        `You have already activated premium on the maximum amount of servers!` + firstDescription
+                    )
+                    .setEmoji("NUCLEUS.PREMIUMACTIVATE")
+                    .setStatus("Danger")
+            ],
+            components: []
+        });
+    } else {
+        client.database.premium.addPremium(interaction.user.id, guild.id);
+        interaction.editReply({
+            embeds: [
+                new EmojiEmbed()
+                    .setTitle("Premium")
+                    .setDescription(
+                        `You have activated premium on this server!` + firstDescription
                     )
                     .setEmoji("NUCLEUS.LOGO")
                     .setStatus("Danger")
             ],
-            components: [
-                new ActionRowBuilder<ButtonBuilder>()
-                    .addComponents(
-                        new ButtonBuilder()
-                            .setStyle(ButtonStyle.Primary)
-                            .setLabel("Activate Premium here")
-                            .setCustomId("premiumActivate")
-                            .setDisabled(count <= 0 && hasPremium)
-                    )
-            ]
+            components: []
         });
-
-        const filter = (i: any) => i.customId === "premiumActivate" && i.user.id === interaction.user.id;
-        let i;
-        try {
-            i = await interaction.channel!.awaitMessageComponent({ filter, time: 60000 });
-        } catch (e) {
-            return;
-        }
-        i.deferUpdate();
-        const guild = i.guild!;
-        if (count - appliesTo.length <= 0) {
-            interaction.editReply({
-                embeds: [
-                    new EmojiEmbed()
-                        .setTitle("Premium")
-                        .setDescription(
-                            `You have already activated premium on the maximum amount of servers!` + firstDescription
-                        )
-                        .setEmoji("NUCLEUS.PREMIUMACTIVATE")
-                        .setStatus("Danger")
-                ],
-                components: []
-            });
-            closed = true;
-        } else {
-            client.database.premium.addPremium(interaction.user.id, guild.id);
-            interaction.editReply({
-                embeds: [
-                    new EmojiEmbed()
-                        .setTitle("Premium")
-                        .setDescription(
-                            `You have activated premium on this server!` + firstDescription
-                        )
-                        .setEmoji("NUCLEUS.LOGO")
-                        .setStatus("Danger")
-                ],
-                components: []
-            });
-            closed = true;
-        }
-
-    } while (!closed);
+    }
 };
 
 export { command };
diff --git a/src/commands/server/buttons.ts b/src/commands/server/buttons.ts
index bc90983..61db825 100644
--- a/src/commands/server/buttons.ts
+++ b/src/commands/server/buttons.ts
@@ -44,7 +44,7 @@
     });
 
     let closed = false;
-    let data: Data = {
+    const data: Data = {
         buttons: [],
         title: null,
         description: null,
@@ -201,9 +201,9 @@
                 }
                 case "send": {
                     await i.deferUpdate();
-                    let channel = interaction.guild!.channels.cache.get(data.channel!) as Discord.TextChannel;
-                    let components = new ActionRowBuilder<ButtonBuilder>();
-                    for(let button of data.buttons) {
+                    const channel = interaction.guild!.channels.cache.get(data.channel!) as Discord.TextChannel;
+                    const components = new ActionRowBuilder<ButtonBuilder>();
+                    for(const button of data.buttons) {
                         components.addComponents(
                             new ButtonBuilder()
                             .setCustomId(button)
@@ -211,9 +211,9 @@
                             .setStyle(ButtonStyle.Primary)
                             );
                         }
-                    let messageData: MessageCreateOptions = {components: [components]}
+                    const messageData: MessageCreateOptions = {components: [components]}
                     if (data.title || data.description) {
-                        let e = new EmojiEmbed()
+                        const e = new EmojiEmbed()
                         if(data.title) e.setTitle(data.title);
                         if(data.description) e.setDescription(data.description);
                         if(data.color) e.setColor(data.color);
@@ -224,7 +224,7 @@
                 }
             }
         } else if(i.isStringSelectMenu()) {
-            try {await i.deferUpdate();} catch (err) {}
+            try {await i.deferUpdate();} catch (err) {console.log(err)}
             switch(i.customId) {
                 case "color": {
                     data.color = colors[i.values[0]!]!;
diff --git a/src/commands/settings/automod.ts b/src/commands/settings/automod.ts
index f10cf67..87b1844 100644
--- a/src/commands/settings/automod.ts
+++ b/src/commands/settings/automod.ts
@@ -646,9 +646,9 @@
     return current
 }
 
-const cleanMenu = async (interaction: StringSelectMenuInteraction, m: Message, current: {
-    channels: string[],
-    allowed: {
+const cleanMenu = async (interaction: StringSelectMenuInteraction, m: Message, current?: {
+    channels?: string[],
+    allowed?: {
         roles: string[],
         user: string[]
     }
@@ -729,12 +729,12 @@
         } else {
             switch (i.customId) {
                 case "toAdd": {
-                    let channelEmbed = new EmojiEmbed()
+                    const channelEmbed = new EmojiEmbed()
                         .setTitle("Clean Settings")
                         .setDescription(`Editing <#${i.values[0]}>`)
                         .setEmoji("GUILD.SETTINGS.GREEN")
                         .setStatus("Success")
-                    let channelButtons = new ActionRowBuilder<ButtonBuilder>()
+                    const channelButtons = new ActionRowBuilder<ButtonBuilder>()
                         .addComponents(
                             new ButtonBuilder()
                                 .setCustomId("back")
@@ -788,7 +788,13 @@
 
     } while(!closed);
 
-    return current;
+    return current as {
+        channels: string[],
+        allowed: {
+            roles: string[],
+            user: string[]
+        }
+    };
 
 }
 
diff --git a/src/commands/settings/autopublish.ts b/src/commands/settings/autopublish.ts
index c4b9b56..f2c367f 100644
--- a/src/commands/settings/autopublish.ts
+++ b/src/commands/settings/autopublish.ts
@@ -58,7 +58,7 @@
             }) as Discord.ButtonInteraction | Discord.ChannelSelectMenuInteraction;
         } catch (e) {
             closed = true;
-            break;
+            continue;
         }
 
         if(i.isButton()) {
@@ -87,7 +87,7 @@
 
 export const check = (interaction: CommandInteraction, _partial: boolean = false) => {
     const member = interaction.member as Discord.GuildMember;
-    const me = interaction.guild!.members.me as Discord.GuildMember;
+    const me = interaction.guild!.members.me!;
     if (!member.permissions.has("ManageMessages"))
         return "You must have the *Manage Messages* permission to use this command";
     if (_partial) return true;
diff --git a/src/commands/settings/logs/attachment.ts b/src/commands/settings/logs/attachment.ts
index 545e3ff..a3b24ff 100644
--- a/src/commands/settings/logs/attachment.ts
+++ b/src/commands/settings/logs/attachment.ts
@@ -18,7 +18,7 @@
         fetchReply: true
     })
 
-    if(!client.database.premium.hasPremium(interaction.guild!.id)) return interaction.editReply({
+    if(!await client.database.premium.hasPremium(interaction.guild!.id)) return interaction.editReply({
         embeds: [
             new EmojiEmbed()
                 .setTitle("Premium Required")
@@ -77,7 +77,7 @@
             })) as Discord.ButtonInteraction | Discord.SelectMenuInteraction;
         } catch (e) {
             closed = true;
-            break;
+            continue;
         }
         await i.deferUpdate();
         if(i.isButton()) {
diff --git a/src/commands/settings/logs/events.ts b/src/commands/settings/logs/events.ts
index a1f24fa..eeef8fb 100644
--- a/src/commands/settings/logs/events.ts
+++ b/src/commands/settings/logs/events.ts
@@ -104,7 +104,7 @@
                 `**Channel:** ${data.channel ? `<#${data.channel}>` : "None"}\n`
             )
 
-        let components: ActionRowBuilder<ButtonBuilder | ChannelSelectMenuBuilder | StringSelectMenuBuilder>[] = [channelMenu, buttons];
+        const components: ActionRowBuilder<ButtonBuilder | ChannelSelectMenuBuilder | StringSelectMenuBuilder>[] = [channelMenu, buttons];
         if(show) components.push(toLogMenu);
 
         await interaction.editReply({
@@ -120,7 +120,7 @@
             }) as ButtonInteraction | StringSelectMenuInteraction | ChannelSelectMenuInteraction;
         } catch (e) {
             closed = true;
-            break;
+            continue;
         }
 
         await i.deferUpdate();
@@ -147,7 +147,7 @@
                 }
             }
         } else if(i.isStringSelectMenu()) {
-            let hex = toHexInteger(i.values);
+            const hex = toHexInteger(i.values);
             data.toLog = hex;
         } else if(i.isChannelSelectMenu()) {
             data.channel = i.values[0]!;
diff --git a/src/commands/settings/logs/warnings.ts b/src/commands/settings/logs/warnings.ts
index 6e5482c..25f9064 100644
--- a/src/commands/settings/logs/warnings.ts
+++ b/src/commands/settings/logs/warnings.ts
@@ -66,7 +66,7 @@
             })) as Discord.ButtonInteraction | Discord.SelectMenuInteraction;
         } catch (e) {
             closed = true;
-            break;
+            continue;
         }
         await i.deferUpdate();
         if(i.isButton()) {
diff --git a/src/commands/settings/tickets.ts b/src/commands/settings/tickets.ts
index af74475..2e046bf 100644
--- a/src/commands/settings/tickets.ts
+++ b/src/commands/settings/tickets.ts
@@ -154,7 +154,7 @@
                                         .setCustomId("maxTickets")
                                         .setPlaceholder("Enter a number")
                                         .setRequired(false)
-                                        .setValue(ticketData.maxTickets.toString() ?? "")
+                                        .setValue(ticketData.maxTickets.toString())
                                         .setMinLength(1)
                                         .setMaxLength(3)
                                         .setStyle(TextInputStyle.Short)
@@ -187,7 +187,7 @@
                     }
                     if (!out || out.isButton()) continue;
                     out = out as ModalSubmitInteraction;
-                    let toAdd = out.fields.getTextInputValue("maxTickets");
+                    const toAdd = out.fields.getTextInputValue("maxTickets");
                     if(isNaN(parseInt(toAdd))) {
                         errorMessage = "You entered an invalid number - No changes were made";
                         break;
@@ -394,11 +394,10 @@
             toAdd = toAdd.substring(0, 80);
             try {
                 if(!data.customTypes) data.customTypes = [];
-                data.customTypes?.push(toAdd);
+                data.customTypes.push(toAdd);
             } catch {
                 continue;
             }
-            data.customTypes = data.customTypes ?? [];
             if (!data.customTypes.includes(toAdd)) {
                 data.customTypes.push(toAdd);
             }
diff --git a/src/commands/settings/tracks.ts b/src/commands/settings/tracks.ts
index 8d2d59d..d9d485d 100644
--- a/src/commands/settings/tracks.ts
+++ b/src/commands/settings/tracks.ts
@@ -217,7 +217,7 @@
             )
             .setStatus("Success")
 
-        let comps: ActionRowBuilder<RoleSelectMenuBuilder | ButtonBuilder | StringSelectMenuBuilder>[] = [roleSelect, buttons];
+        const comps: ActionRowBuilder<RoleSelectMenuBuilder | ButtonBuilder | StringSelectMenuBuilder>[] = [roleSelect, buttons];
         if(current.track.length >= 1) comps.splice(1, 0, selectMenu);
 
         interaction.editReply({embeds: [embed], components: comps});
diff --git a/src/commands/settings/welcome.ts b/src/commands/settings/welcome.ts
index ae55fc0..7584624 100644
--- a/src/commands/settings/welcome.ts
+++ b/src/commands/settings/welcome.ts
@@ -215,7 +215,7 @@
                         out = null;
                     }
                     if(!out) break;
-                    data.message = out.fields.getTextInputValue("message") ?? null;
+                    data.message = out.fields.getTextInputValue("message");
                     break;
                 }
                 case "save": {
diff --git a/src/commands/tags/edit.ts b/src/commands/tags/edit.ts
index a80869e..7e297c8 100644
--- a/src/commands/tags/edit.ts
+++ b/src/commands/tags/edit.ts
@@ -19,9 +19,9 @@
 
 const callback = async (interaction: CommandInteraction): Promise<unknown> => {
     if (!interaction.guild) return;
-    const name = interaction.options.get("name")?.value as string;
-    const value = interaction.options.get("value")?.value as string ?? "";
-    const newname = interaction.options.get("newname")?.value as string ?? "";
+    const name = (interaction.options.get("name")?.value ?? "") as string;
+    const value = (interaction.options.get("value")?.value ?? "") as string;
+    const newname = (interaction.options.get("newname")?.value ?? "") as string;
     if (!newname && !value)
         return await interaction.reply({
             embeds: [
diff --git a/src/commands/user/role.ts b/src/commands/user/role.ts
index 5aa8782..41820ac 100644
--- a/src/commands/user/role.ts
+++ b/src/commands/user/role.ts
@@ -27,12 +27,12 @@
     let member = interaction.options.getMember("user") as GuildMember | null;
 
     if(!member) {
-        let memberEmbed = new EmojiEmbed()
+        const memberEmbed = new EmojiEmbed()
             .setTitle("Role")
             .setDescription(`Please choose a member to edit the roles of.`)
             .setEmoji("GUILD.ROLES.CREATE")
             .setStatus("Success");
-        let memberChooser = new ActionRowBuilder<UserSelectMenuBuilder>().addComponents(
+        const memberChooser = new ActionRowBuilder<UserSelectMenuBuilder>().addComponents(
             new UserSelectMenuBuilder()
                 .setCustomId("memberChooser")
                 .setPlaceholder("Select a member")
@@ -48,7 +48,6 @@
             return;
         }
 
-        if(!i) return;
         memberEmbed.setDescription(`Editing roles for ${renderUser(i.values[0]!)}`);
         await i.deferUpdate();
         await interaction.editReply({ embeds: LoadingEmbed, components: [] })
@@ -67,14 +66,17 @@
         );
 
     do {
+
+        const removing = rolesToChange.filter((r) => member!.roles.cache.has(r)).map((r) => canEdit(interaction.guild?.roles.cache.get(r)!, interaction.member as GuildMember, interaction.guild?.members.me!)[0])
+        const adding = rolesToChange.filter((r) => !member!.roles.cache.has(r)).map((r) => canEdit(interaction.guild?.roles.cache.get(r)!, interaction.member as GuildMember, interaction.guild?.members.me!)[0])
         const embed = new EmojiEmbed()
         .setTitle("Role")
         .setDescription(
             `${getEmojiByName("ICONS.EDIT")} Editing roles for <@${member.id}>\n\n` +
             `Adding:\n` +
-            `${listToAndMore(rolesToChange.filter((r) => !member!.roles.cache.has(r)).map((r) => canEdit(interaction.guild?.roles.cache.get(r)!, interaction.member as GuildMember, interaction.guild?.members.me!)[0]) || ["None"], 5)}\n` +
+            `${listToAndMore(adding.length > 0 ? adding : ["None"], 5)}\n` +
             `Removing:\n` +
-            `${listToAndMore(rolesToChange.filter((r) => member!.roles.cache.has(r)).map((r) => canEdit(interaction.guild?.roles.cache.get(r)!, interaction.member as GuildMember, interaction.guild?.members.me!)[0]) || ["None"], 5)}\n`
+            `${listToAndMore(removing.length > 0 ? removing : ["None"], 5)}\n`
         )
         .setEmoji("GUILD.ROLES.CREATE")
         .setStatus("Success");
@@ -99,18 +101,18 @@
         try {
             i = await m.awaitMessageComponent({ filter: (i) => i.user.id === interaction.user.id, time: 300000 }) as RoleSelectMenuInteraction | ButtonInteraction;
         } catch (e) {
-            return;
+            closed = true;
+            continue;
         }
 
-        if(!i) return;
         i.deferUpdate();
         if(i.isButton()) {
             switch(i.customId) {
-                case "roleSave":
+                case "roleSave": {
                     const roles = rolesToChange.map((r) => interaction.guild?.roles.cache.get(r)!);
                     await interaction.editReply({ embeds: LoadingEmbed, components: [] });
-                    let rolesToAdd: Role[] = [];
-                    let rolesToRemove: Role[] = [];
+                    const rolesToAdd: Role[] = [];
+                    const rolesToRemove: Role[] = [];
                     for(const role of roles) {
                         if(!canEdit(role, interaction.member as GuildMember, interaction.guild?.members.me!)[1]) continue;
                         if(member.roles.cache.has(role.id)) {
@@ -123,10 +125,12 @@
                     await member.roles.remove(rolesToRemove);
                     rolesToChange = [];
                     break;
-                case "roleDiscard":
+                }
+                case "roleDiscard": {
                     rolesToChange = [];
                     await interaction.editReply({ embeds: LoadingEmbed, components: [] });
                     break;
+                }
             }
         } else {
             rolesToChange = i.values;
diff --git a/src/events/guildMemberUpdate.ts b/src/events/guildMemberUpdate.ts
index 412ac96..b674060 100644
--- a/src/events/guildMemberUpdate.ts
+++ b/src/events/guildMemberUpdate.ts
@@ -1,60 +1,76 @@
 import { AuditLogEvent, GuildAuditLogsEntry, GuildMember } from "discord.js";
 import type { NucleusClient } from "../utils/client.js";
 import type { LoggerOptions } from "../utils/log.js";
+import { generalException } from "../utils/createTemporaryStorage.js";
 
 export const event = "guildMemberUpdate";
 
 export async function callback(client: NucleusClient, before: GuildMember, after: GuildMember) {
     const { log, NucleusColors, entry, renderUser, renderDelta, getAuditLog } = client.logger;
 
+    if(!before.roles.cache.equals(after.roles.cache)) {
+        const auditLog = (await getAuditLog(after.guild, AuditLogEvent.MemberRoleUpdate))
+            .filter((entry: GuildAuditLogsEntry) => (entry.target as GuildMember)!.id === after.id)[0];
+        if (!auditLog) return;
+        if (client.noLog.includes(`${after.guild.id}${after.id}${auditLog.id}`)) return;
+        generalException(`${after.guild.id}${after.id}${auditLog.id}`);
+        if (auditLog.executor!.id !== client.user!.id) {
+            const rolesAdded = after.roles.cache.filter(role => !before.roles.cache.has(role.id));
+            const rolesRemoved = before.roles.cache.filter(role => !after.roles.cache.has(role.id));
+            let displayName = "Roles Removed";
+            let color = NucleusColors.red;
+            let emoji = "GUILD.ROLES.DELETE";
+            if(rolesAdded.size > 0 && rolesRemoved.size > 0) {displayName = "Roles Changed"; color = NucleusColors.yellow; emoji = "GUILD.ROLES.EDIT";}
+            else if(rolesAdded.size > 0) {displayName = "Roles Added"; color = NucleusColors.green; emoji = "GUILD.ROLES.CREATE";}
+            const removedEntry = rolesRemoved.map(role => role.id);
+            const addedEntry = rolesAdded.map(role => role.id);
+
+            let list = {
+                memberId: entry(after.id, `\`${after.id}\``),
+                name: entry(after.user.id, renderUser(after.user)),
+            };
+
+            if (rolesAdded.size > 0) {
+                list = Object.assign(list, {rolesAdded: entry(addedEntry, addedEntry.map(id => `<@&${id}>`).join(", "))});
+            }
+            if (rolesRemoved.size > 0) {
+                list = Object.assign(list, {rolesRemoved: entry(removedEntry, removedEntry.map(id => `<@&${id}>`).join(", "))});
+            }
+
+            list = Object.assign(list, {
+                changed: entry(Date.now(), renderDelta(Date.now())),
+                changedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!))
+            });
+
+            let data: LoggerOptions = {
+                meta: {
+                    type: "memberUpdate",
+                    displayName: displayName,
+                    calculateType: "guildMemberUpdate",
+                    color: color,
+                    emoji: emoji,
+                    timestamp: Date.now()
+                },
+                list: {},
+                hidden: {
+                    guild: after.guild.id
+                }
+            };
+
+            if(rolesAdded.size > 0) {
+                list = Object.assign(list, {rolesAdded: entry(addedEntry, addedEntry.map(id => `<@&${id}>`).join(", "))});
+            }
+            if(rolesRemoved.size > 0) {
+                list = Object.assign(list, {rolesRemoved: entry(removedEntry, removedEntry.map(id => `<@&${id}>`).join(", "))});
+            }
+            data = Object.assign(data, {list: list});
+            log(data);
+        }
+    }
     const auditLog = (await getAuditLog(after.guild, AuditLogEvent.MemberUpdate))
         .filter((entry: GuildAuditLogsEntry) => (entry.target as GuildMember)!.id === after.id)[0];
     if (!auditLog) return;
     if (auditLog.executor!.id === client.user!.id) return;
-    if(!before.roles.cache.equals(after.roles.cache)) {
-        let rolesAdded = after.roles.cache.filter(role => !before.roles.cache.has(role.id));
-        let rolesRemoved = before.roles.cache.filter(role => !after.roles.cache.has(role.id));
-        let displayName = "Roles Removed";
-        let color = NucleusColors.red;
-        let emoji = "GUILD.ROLES.DELETE";
-        if(rolesAdded.size > 0 && rolesRemoved.size > 0) {displayName = "Roles Changed"; color = NucleusColors.yellow; emoji = "GUILD.ROLES.EDIT";}
-        else if(rolesAdded.size > 0) {displayName = "Roles Added"; color = NucleusColors.green; emoji = "GUILD.ROLES.CREATE";}
-        let removedEntry = rolesRemoved.map(role => role.id);
-        let addedEntry = rolesAdded.map(role => role.id);
-
-        let list = {
-            memberId: entry(after.id, `\`${after.id}\``),
-            name: entry(after.user.id, renderUser(after.user)),
-            changed: entry(Date.now(), renderDelta(Date.now())),
-            changedBy: entry(auditLog.executor!.id, renderUser(auditLog.executor!))
-        };
-
-        let data: LoggerOptions = {
-            meta: {
-                type: "memberUpdate",
-                displayName: displayName,
-                calculateType: "guildMemberUpdate",
-                color: color,
-                emoji: emoji,
-                timestamp: Date.now()
-            },
-            list: {
-
-            },
-            hidden: {
-                guild: after.guild.id
-            }
-        };
-
-        if(rolesAdded.size > 0) {
-            list = Object.assign(list, {rolesAdded: entry(addedEntry, addedEntry.map(id => `<@&${id}>`).join(", "))});
-        }
-        if(rolesRemoved.size > 0) {
-            list = Object.assign(list, {rolesRemoved: entry(removedEntry, removedEntry.map(id => `<@&${id}>`).join(", "))});
-        }
-        data = Object.assign(data, {list: list});
-        log(data);
-    }
     if (before.nickname !== after.nickname) {
         await client.database.history.create(
             "nickname",
diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts
index 7f8e5d1..44017d7 100644
--- a/src/events/messageCreate.ts
+++ b/src/events/messageCreate.ts
@@ -26,9 +26,9 @@
     const content = message.content.toLowerCase() || "";
     const config = await client.memory.readGuildInfo(message.guild.id);
     if(config.filters.clean.channels.includes(message.channel.id)) {
-        let memberRoles = message.member!.roles.cache.map(role => role.id);
-        let roleAllow = config.filters.clean.allowed.roles.some(role => memberRoles.includes(role));
-        let userAllow = config.filters.clean.allowed.user.includes(message.author.id);
+        const memberRoles = message.member!.roles.cache.map(role => role.id);
+        const roleAllow = config.filters.clean.allowed.roles.some(role => memberRoles.includes(role));
+        const userAllow = config.filters.clean.allowed.user.includes(message.author.id);
         if(!roleAllow && !userAllow) return await message.delete();
     }
 
diff --git a/src/events/stickerDelete.ts b/src/events/stickerDelete.ts
index fcfc3a6..87a991f 100644
--- a/src/events/stickerDelete.ts
+++ b/src/events/stickerDelete.ts
@@ -16,7 +16,7 @@
             calculateType: "stickerUpdate",
             color: NucleusColors.red,
             emoji: "GUILD.STICKER.DELETE",
-            timestamp: auditLog.createdTimestamp ?? Date.now()
+            timestamp: auditLog.createdTimestamp
         },
         list: {
             stickerId: entry(sticker.id, `\`${sticker.id}\``),
diff --git a/src/premium/createTranscript.ts b/src/premium/createTranscript.ts
index 111f1a0..fb6dde7 100644
--- a/src/premium/createTranscript.ts
+++ b/src/premium/createTranscript.ts
@@ -112,9 +112,9 @@
         }
     });
 
-    let interactionMember = await interaction.guild?.members.fetch(interaction.user.id)
+    const interactionMember = await interaction.guild?.members.fetch(interaction.user.id)
 
-    let newOut: Transcript = {
+    const newOut: Transcript = {
         type: "ticket",
         guild: interaction.guild!.id,
         channel: interaction.channel!.id,
@@ -131,7 +131,7 @@
     }
     if(interactionMember?.roles.icon) newOut.createdBy.topRole.badgeURL = interactionMember.roles.icon.iconURL()!;
     messages.reverse().forEach((message) => {
-        let msg: TranscriptMessage = {
+        const msg: TranscriptMessage = {
             id: message.id,
             author: {
                 username: message.author.username,
@@ -146,7 +146,7 @@
         if (message.member!.roles.icon) msg.author.topRole.badgeURL = message.member!.roles.icon.iconURL()!;
         if (message.content) msg.content = message.content;
         if (message.embeds.length > 0) msg.embeds = message.embeds.map(embed => {
-            let obj: TranscriptEmbed = {};
+            const obj: TranscriptEmbed = {};
             if (embed.title) obj.title = embed.title;
             if (embed.description) obj.description = embed.description;
             if (embed.fields.length > 0) obj.fields = embed.fields.map(field => {
@@ -163,7 +163,7 @@
             return obj;
         });
         if (message.components.length > 0) msg.components = message.components.map(component => component.components.map(child => {
-            let obj: TranscriptComponent = {
+            const obj: TranscriptComponent = {
                 type: child.type
             }
             if (child.type === ComponentType.Button) {
@@ -175,7 +175,7 @@
             return obj
         }));
         if (message.editedTimestamp) msg.editedTimestamp = message.editedTimestamp;
-        if (message.flags) msg.flags = message.flags.toArray();
+        msg.flags = message.flags.toArray();
 
         if (message.stickers.size > 0) msg.stickerURLs = message.stickers.map(sticker => sticker.url);
         if (message.reference) msg.referencedMessage = [message.reference.guildId ?? "", message.reference.channelId, message.reference.messageId ?? ""];
diff --git a/src/utils/createTemporaryStorage.ts b/src/utils/createTemporaryStorage.ts
index a684d9d..e8a8073 100644
--- a/src/utils/createTemporaryStorage.ts
+++ b/src/utils/createTemporaryStorage.ts
@@ -1,6 +1,6 @@
 import client from "./client.js";
 
-function generalException(location: string) {
+export function generalException(location: string) {
     client.noLog.push(location);
     setTimeout(() => {
         client.noLog = client.noLog.filter((i: string) => {
@@ -29,4 +29,4 @@
         })
         client.preloadPage = Object.fromEntries(object);
     }, 60 * 5 * 1000);
-}
\ No newline at end of file
+}
diff --git a/src/utils/log.ts b/src/utils/log.ts
index 2d15192..87549dd 100644
--- a/src/utils/log.ts
+++ b/src/utils/log.ts
@@ -94,7 +94,7 @@
                 }
             });
             if (channel) {
-                log.separate = log.separate || {};
+                log.separate = log.separate ?? {};
                 const embed = new Discord.EmbedBuilder()
                     .setTitle(`${getEmojiByName(log.meta.emoji)} ${log.meta.displayName}`)
                     .setDescription(
