diff --git a/src/commands/nucleus/premium.ts b/src/commands/nucleus/premium.ts
index 58b51a9..4effb23 100644
--- a/src/commands/nucleus/premium.ts
+++ b/src/commands/nucleus/premium.ts
@@ -194,7 +194,8 @@
     }
 
     let userPremiumServers = "";
-    if ((dbMember?.appliesTo.length ?? 0) > 0) userPremiumServers = "\nIf you want to remove premium from a server, run this command in your DMs with me.";
+    if ((dbMember?.appliesTo.length ?? 0) > 0)
+        userPremiumServers = "\nIf you want to remove premium from a server, run this command in your DMs with me.";
 
     interaction.editReply({
         embeds: [
@@ -223,7 +224,9 @@
                 new EmojiEmbed()
                     .setTitle("Premium")
                     .setDescription(
-                        `You have already activated premium on the maximum amount of servers!` + userPremiumServers + firstDescription
+                        `You have already activated premium on the maximum amount of servers!` +
+                            userPremiumServers +
+                            firstDescription
                     )
                     .setEmoji("NUCLEUS.PREMIUMACTIVATE")
                     .setStatus("Danger")
@@ -236,7 +239,9 @@
             embeds: [
                 new EmojiEmbed()
                     .setTitle("Premium")
-                    .setDescription(`You have activated premium on this server!` + userPremiumServers + firstDescription)
+                    .setDescription(
+                        `You have activated premium on this server!` + userPremiumServers + firstDescription
+                    )
                     .setEmoji("NUCLEUS.LOGO")
                     .setStatus("Danger")
             ],
diff --git a/src/commands/privacy.ts b/src/commands/privacy.ts
index 0be4880..590e866 100644
--- a/src/commands/privacy.ts
+++ b/src/commands/privacy.ts
@@ -33,7 +33,7 @@
                     )
                     .setEmoji("NUCLEUS.LOGO")
                     .setStatus("Danger")
-                    .setFooter({text: "https://clicksminuteper.github.io/policies/nucleus"})
+                    .setFooter({ text: "https://clicksminuteper.github.io/policies/nucleus" })
             )
             .setTitle("Welcome")
             .setDescription("General privacy information")
@@ -48,7 +48,7 @@
                     )
                     .setEmoji("NUCLEUS.LOGO")
                     .setStatus("Danger")
-                    .setFooter({text: "https://clicksminuteper.github.io/policies/nucleus"})
+                    .setFooter({ text: "https://clicksminuteper.github.io/policies/nucleus" })
             )
             .setTitle("Scanners")
             .setDescription("About Unscan")
@@ -62,7 +62,7 @@
                     )
                     .setEmoji("NUCLEUS.LOGO")
                     .setStatus("Danger")
-                    .setFooter({text: "https://clicksminuteper.github.io/policies/nucleus"})
+                    .setFooter({ text: "https://clicksminuteper.github.io/policies/nucleus" })
             )
             .setTitle("Link scanning and Transcripts")
             .setDescription("Information about how links and images are scanned, and transcripts are stored")
@@ -77,7 +77,7 @@
                               .setDescription("Below are buttons for controlling this servers privacy settings")
                               .setEmoji("NUCLEUS.LOGO")
                               .setStatus("Danger")
-                              .setFooter({text: "https://clicksminuteper.github.io/policies/nucleus"})
+                              .setFooter({ text: "https://clicksminuteper.github.io/policies/nucleus" })
                       )
                       .setTitle("Options")
                       .setDescription("Options")
diff --git a/src/commands/settings/tracks.ts b/src/commands/settings/tracks.ts
index 7e341c4..5215b3f 100644
--- a/src/commands/settings/tracks.ts
+++ b/src/commands/settings/tracks.ts
@@ -248,7 +248,8 @@
                     }need a role in this track\n` +
                     `${getEmojiByName("CONTROL." + (current.retainPrevious ? "TICK" : "CROSS"))} Members ${
                         current.retainPrevious ? "" : "don't "
-                    }keep all roles below their current highest\n\n` + (previousMessage ? previousMessage + "\n\n": "") +
+                    }keep all roles below their current highest\n\n` +
+                    (previousMessage ? previousMessage + "\n\n" : "") +
                     createVerticalTrack(
                         mapped.map((role) => renderRole(role)),
                         new Array(current.track.length).fill(false),
@@ -322,7 +323,7 @@
                 case "addRole": {
                     const role = out.values![0]!;
                     const roleObj = roles.get(role)!;
-                    if (roleObj.position >= (interaction.member as GuildMember).roles.highest.position){
+                    if (roleObj.position >= (interaction.member as GuildMember).roles.highest.position) {
                         previousMessage = "You can't add a role that is higher than your highest role.";
                     } else {
                         if (!current.track.includes(role)) {
diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts
index fe2e27c..854e85c 100644
--- a/src/events/messageCreate.ts
+++ b/src/events/messageCreate.ts
@@ -20,7 +20,7 @@
         message.channel.type === ChannelType.GuildAnnouncement &&
         message.reference === null
     ) {
-        if(message.channel.permissionsFor(message.guild.members.me!)!.has("ManageMessages")) {
+        if (message.channel.permissionsFor(message.guild.members.me!)!.has("ManageMessages")) {
             await message.crosspost();
         } else {
             singleNotify(`I don't have permissions to publish in <#${message.channel.id}>`, message.guild.id, true);
diff --git a/src/index.ts b/src/index.ts
index 875bf45..50a1526 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -17,7 +17,6 @@
     }
     await client.database.premium.checkAllPremium();
     await client.database.guilds.updateAllGuilds();
-
 });
 
 process.on("unhandledRejection", (err) => {
diff --git a/src/utils/database.ts b/src/utils/database.ts
index c46a39d..89c108b 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -55,7 +55,7 @@
             } catch (e) {
                 guildObj = null;
             }
-            if(!guildObj) await this.delete(guild.id);
+            if (!guildObj) await this.delete(guild.id);
         }
     }
 
@@ -251,8 +251,13 @@
             .replace(/\//g, "_")
             .replace(/\+/g, "-")
             .substring(0, 32);
-        const iv = getIV().toString("base64").substring(0, 16).replace(/=/g, "").replace(/\//g, "_").replace(/\+/g, "-");
-	console.log(iv);
+        const iv = getIV()
+            .toString("base64")
+            .substring(0, 16)
+            .replace(/=/g, "")
+            .replace(/\//g, "_")
+            .replace(/\+/g, "-");
+        console.log(iv);
         for (const message of transcript.messages) {
             if (message.content) {
                 const encCipher = crypto.createCipheriv("AES-256-CBC", key, iv);
@@ -321,10 +326,10 @@
     }
 
     async read(code: string, key: string, iv: string) {
-        console.log("Transcript read")
+        console.log("Transcript read");
         let doc: TranscriptSchema | null = await this.transcripts.findOne({ code: code });
         let findDoc: findDocSchema | null = null;
-	console.log(doc)
+        console.log(doc);
         if (!doc) findDoc = await this.messageToTranscript.findOne({ transcript: code });
         if (findDoc) {
             const message = await (
@@ -350,7 +355,7 @@
             if (!data) return null;
             doc = JSON.parse(Buffer.from(data).toString()) as TranscriptSchema;
         }
-	console.log(doc)
+        console.log(doc);
         if (!doc) return null;
         for (const message of doc.messages) {
             if (message.content) {
@@ -406,8 +411,8 @@
                     topRole: {
                         color: message.member ? message.member.roles.highest.color : 0x000000
                     },
-                    iconURL: (message.member?.user || message.author)?.displayAvatarURL({ forceStatic: true }),
-                    bot: message.author?.bot || false
+                    iconURL: (message.member?.user || message.author).displayAvatarURL({ forceStatic: true }),
+                    bot: message.author.bot || false
                 },
                 createdTimestamp: message.createdTimestamp
             };
diff --git a/src/utils/log.ts b/src/utils/log.ts
index f1c03ef..b29f365 100644
--- a/src/utils/log.ts
+++ b/src/utils/log.ts
@@ -4,7 +4,7 @@
 import { promisify } from "util";
 import generateKeyValueList from "./generateKeyValueList.js";
 import client from "./client.js";
-import {DiscordAPIError} from "discord.js";
+import { DiscordAPIError } from "discord.js";
 
 const wait = promisify(setTimeout);
 
@@ -44,12 +44,12 @@
         return `${user.username} [<@${user.id}>]`;
     },
     renderTime(t: number) {
-        if(isNaN(t)) return "Unknown"
+        if (isNaN(t)) return "Unknown";
         t = Math.floor((t /= 1000));
         return `<t:${t}:D> at <t:${t}:T>`;
     },
     renderDelta(t: number) {
-        if(isNaN(t)) return "Unknown"
+        if (isNaN(t)) return "Unknown";
         t = Math.floor((t /= 1000));
         return `<t:${t}:R> (<t:${t}:D> at <t:${t}:T>)`;
     },
diff --git a/src/utils/migration/migration.ts b/src/utils/migration/migration.ts
index 0f54724..6286465 100644
--- a/src/utils/migration/migration.ts
+++ b/src/utils/migration/migration.ts
@@ -1,18 +1,20 @@
-import * as fs from 'fs';
+import * as fs from "fs";
 import client from "../client.js";
 import _ from "lodash";
 
-const dir = './data';
+const dir = "./data";
 const files = fs.readdirSync(dir);
 
 for (const file of files) {
     // eslint-disable-next-line @typescript-eslint/no-explicit-any
     let rsmData: any;
     try {
-        rsmData = JSON.parse(fs.readFileSync(`${dir}/${file}`, 'utf8'));
-    } catch { continue }
+        rsmData = JSON.parse(fs.readFileSync(`${dir}/${file}`, "utf8"));
+    } catch {
+        continue;
+    }
     if (!rsmData.version || rsmData.version < 3) continue;
-    const nucleusData = await client.database.guilds.readOld(rsmData.guild_info.id)
+    const nucleusData = await client.database.guilds.readOld(rsmData.guild_info.id);
     const rsmToNucleus = {
         id: rsmData.guild_info.id,
         version: 1,
@@ -20,54 +22,54 @@
         filters: {
             images: {
                 NSFW: rsmData.images?.nsfw,
-                size: rsmData.images?.toosmall,
+                size: rsmData.images?.toosmall
             },
             malware: null,
             wordFilter: {
                 enabled: true,
                 words: {
                     strict: rsmData.wordfilter?.strict,
-                    loose: rsmData.wordfilter?.soft,
+                    loose: rsmData.wordfilter?.soft
                 },
                 allowed: {
                     users: rsmData.wordfilter?.ignore?.members,
                     roles: rsmData.wordfilter?.ignore?.roles,
-                    channels: rsmData.wordfilter?.ignore?.channels,
-                },
+                    channels: rsmData.wordfilter?.ignore?.channels
+                }
             },
             invite: {
                 enabled: rsmData.invite?.enabled,
                 allowed: {
                     channels: rsmData.invite?.whitelist?.members,
                     roles: rsmData.invite?.whitelist?.roles,
-                    users: rsmData.invite?.whitelist?.channels,
-                },
+                    users: rsmData.invite?.whitelist?.channels
+                }
             }
         },
         welcome: {
             enabled: true,
             role: rsmData.welcome?.role,
             channel: rsmData.welcome?.message?.channel,
-            message: rsmData.welcome?.message?.text ?? null,
+            message: rsmData.welcome?.message?.text ?? null
         },
         logging: {
             logs: {
                 enabled: true,
-                channel: rsmData.log_info?.log_channel,
+                channel: rsmData.log_info?.log_channel
             },
             staff: {
-                channel: rsmData.log_info?.staff,
+                channel: rsmData.log_info?.staff
             }
         },
         verify: {
             enabled: true,
-            role: rsmData.verify_role,
+            role: rsmData.verify_role
         },
         tickets: {
             enabled: true,
             category: rsmData.modmail?.cat,
             supportRole: rsmData.modmail?.mention,
-            maxTickets: rsmData.modmail?.max,
+            maxTickets: rsmData.modmail?.max
         },
         tags: rsmData.tags
     } as Partial<ReturnType<typeof client.database.guilds.read>>;
@@ -75,5 +77,4 @@
     const merged = _.merge(nucleusData, rsmToNucleus);
     // console.log(merged)
     await client.database.guilds.write(merged.id!, merged);
-
 }
