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);
-
 }
