diff --git a/src/commands/help.ts b/src/commands/help.ts
index 041fb47..f95eb6e 100644
--- a/src/commands/help.ts
+++ b/src/commands/help.ts
@@ -22,7 +22,10 @@
 import { getCommandByName, getCommandMentionByName } from "../utils/getCommandDataByName.js";
 import getEmojiByName from "../utils/getEmojiByName.js";
 
-const command = new SlashCommandBuilder().setName("help").setDescription("Shows help for commands").setDMPermission(true);
+const command = new SlashCommandBuilder()
+    .setName("help")
+    .setDescription("Shows help for commands")
+    .setDMPermission(true);
 
 const styles: Record<string, { emoji: string }> = {
     help: { emoji: "NUCLEUS.LOGO" },
@@ -127,9 +130,9 @@
                 );
             }
             for (const option of options) {
-                optionString += ` - \`${option.name}\` (${ApplicationCommandOptionType[option.type].replace("Integer", "Number").replace("String", "Text")}) - ${
-                    option.description
-                }\n`;
+                optionString += ` - \`${option.name}\` (${ApplicationCommandOptionType[option.type]
+                    .replace("Integer", "Number")
+                    .replace("String", "Text")}) - ${option.description}\n`;
             }
             const APICommand =
                 client.commands[
@@ -140,7 +143,9 @@
                 allowedToRun = await APICommand.check(interaction as Interaction, true);
             }
             embed.setDescription(
-                `${getEmojiByName(styles[currentPath[0]]!.emoji)} **${capitalize(currentData.name)}** | ${currentData.mention}\n\n` +
+                `${getEmojiByName(styles[currentPath[0]]!.emoji)} **${capitalize(currentData.name)}** | ${
+                    currentData.mention
+                }\n\n` +
                     `${currentData.description}\n\n` +
                     (APICommand
                         ? `${getEmojiByName(allowedToRun ? "CONTROL.TICK" : "CONTROL.CROSS")} You ${
diff --git a/src/commands/mod/nick.ts b/src/commands/mod/nick.ts
index ed14efb..178246a 100644
--- a/src/commands/mod/nick.ts
+++ b/src/commands/mod/nick.ts
@@ -81,7 +81,7 @@
                 "Change nickname",
                 "ICONS.EDIT",
                 "modal",
-                {default: newNickname ?? ""},
+                { default: newNickname ?? "" },
                 new ModalBuilder().setTitle("Editing nickname").addComponents(
                     new ActionRowBuilder<TextInputBuilder>().addComponents(
                         new TextInputBuilder()
diff --git a/src/commands/nucleus/stats.ts b/src/commands/nucleus/stats.ts
index c2bf9a1..9690258 100644
--- a/src/commands/nucleus/stats.ts
+++ b/src/commands/nucleus/stats.ts
@@ -21,7 +21,6 @@
 const command = (builder: SlashCommandSubcommandBuilder) =>
     builder.setName("stats").setDescription("Gets the bot's stats");
 
-
 const confirm = async (interaction: CommandInteraction) => {
     const requiredTexts = [
         "just do it",
@@ -36,23 +35,23 @@
         "what's a java script",
         "it's a feature not a bug",
         "that never happened during testing"
-    ]
+    ];
     const chosen = requiredTexts[Math.floor(Math.random() * (requiredTexts.length - 1))]!;
 
     const modal = new ModalBuilder()
-            .addComponents(
-                new ActionRowBuilder<TextInputBuilder>().addComponents(
-                    new TextInputBuilder()
-                        .setStyle(TextInputStyle.Short)
-                        .setLabel(`Type "${chosen}" below`)
-                        .setCustomId("confirm")
-                        .setPlaceholder("Guild ID")
-                        .setMinLength(chosen.length)
-                        .setMaxLength(chosen.length)
-                )
+        .addComponents(
+            new ActionRowBuilder<TextInputBuilder>().addComponents(
+                new TextInputBuilder()
+                    .setStyle(TextInputStyle.Short)
+                    .setLabel(`Type "${chosen}" below`)
+                    .setCustomId("confirm")
+                    .setPlaceholder("Guild ID")
+                    .setMinLength(chosen.length)
+                    .setMaxLength(chosen.length)
             )
-            .setTitle("Admin Panel")
-            .setCustomId("adminPanel");
+        )
+        .setTitle("Admin Panel")
+        .setCustomId("adminPanel");
     await interaction.showModal(modal);
     let out: ModalSubmitInteraction;
     try {
@@ -65,9 +64,8 @@
     }
     await out.deferUpdate();
     const typed = out.fields.getTextInputValue("confirm");
-    return typed.toLowerCase() === chosen.toLowerCase()
-}
-
+    return typed.toLowerCase() === chosen.toLowerCase();
+};
 
 const callback = async (interaction: CommandInteraction): Promise<void> => {
     const description = `**Servers:** ${client.guilds.cache.size}\n` + `**Ping:** \`${client.ws.ping * 2}ms\``;
@@ -159,7 +157,7 @@
                     new ButtonBuilder().setCustomId("data").setLabel("Guild data").setStyle(ButtonStyle.Secondary),
                     new ButtonBuilder().setCustomId("cache").setLabel("Reset cache").setStyle(ButtonStyle.Success),
                     new ButtonBuilder().setCustomId("leave").setLabel("Leave").setStyle(ButtonStyle.Danger),
-                    new ButtonBuilder().setCustomId("purge").setLabel("Delete data").setStyle(ButtonStyle.Danger),
+                    new ButtonBuilder().setCustomId("purge").setLabel("Delete data").setStyle(ButtonStyle.Danger)
                 )
             ]
         });
@@ -186,87 +184,79 @@
             await interaction.editReply({
                 embeds: [
                     new EmojiEmbed()
-                    .setTitle("Stats")
-                    .setDescription(
-                        `**Name:** ${guild.name}\n` +
-                        `**ID:** \`${guild.id}\`\n` +
-                        `**Owner:** ${client.users.cache.get(guild.ownerId)!.tag}\n` +
-                        `**Member Count:** ${guild.memberCount}\n` +
-                        `**Created:** <t:${guild.createdTimestamp}:F>\n` +
-                        `**Added Nucleus:** <t:${guild.members.me!.joinedTimestamp}:R>\n` +
-                        `**Nucleus' Perms:** https://discordapi.com/permissions.html#${guild.members.me!.permissions.valueOf()}\n`
+                        .setTitle("Stats")
+                        .setDescription(
+                            `**Name:** ${guild.name}\n` +
+                                `**ID:** \`${guild.id}\`\n` +
+                                `**Owner:** ${client.users.cache.get(guild.ownerId)!.tag}\n` +
+                                `**Member Count:** ${guild.memberCount}\n` +
+                                `**Created:** <t:${guild.createdTimestamp}:F>\n` +
+                                `**Added Nucleus:** <t:${guild.members.me!.joinedTimestamp}:R>\n` +
+                                `**Nucleus' Perms:** https://discordapi.com/permissions.html#${guild.members.me!.permissions.valueOf()}\n`
                         )
                         .setStatus("Success")
                         .setEmoji("SETTINGS.STATS.GREEN")
-                    ]
-                });
-            } else if (i.customId === "leave") {
-                if (!await confirm(interaction)) {
-                    await interaction.editReply({
-                        embeds: [
-                            new EmojiEmbed()
-                            .setTitle("No changes were made")
-                            .setStatus("Danger")
-                        ],
-                        components: []
-                    });
-                    return;
-                }
-                await guild.leave();
+                ]
+            });
+        } else if (i.customId === "leave") {
+            if (!(await confirm(interaction))) {
                 await interaction.editReply({
-                    embeds: [
-                        new EmojiEmbed()
+                    embeds: [new EmojiEmbed().setTitle("No changes were made").setStatus("Danger")],
+                    components: []
+                });
+                return;
+            }
+            await guild.leave();
+            await interaction.editReply({
+                embeds: [
+                    new EmojiEmbed()
                         .setTitle("Left")
                         .setDescription(`Left ${guild.name}`)
                         .setStatus("Success")
                         .setEmoji("SETTINGS.STATS.GREEN")
-                    ],
+                ],
+                components: []
+            });
+        } else if (i.customId === "data") {
+            await i.deferUpdate();
+            // Get all the data and convert to a string
+            const data = await client.database.guilds.read(guild.id);
+            const stringified = JSON.stringify(data, null, 2);
+            const buffer = Buffer.from(stringified);
+            const attachment = new AttachmentBuilder(buffer).setName("data.json");
+            await interaction.editReply({
+                embeds: [
+                    new EmojiEmbed().setTitle("Data").setDescription(`Data for ${guild.name}`).setStatus("Success")
+                ],
+                components: [],
+                files: [attachment]
+            });
+        } else if (i.customId === "purge") {
+            if (!(await confirm(interaction))) {
+                await interaction.editReply({
+                    embeds: [new EmojiEmbed().setTitle("No changes were made").setStatus("Danger")],
                     components: []
                 });
-            } else if (i.customId === "data") {
-                await i.deferUpdate();
-                // Get all the data and convert to a string
-                const data = await client.database.guilds.read(guild.id);
-                const stringified = JSON.stringify(data, null, 2);
-                const buffer = Buffer.from(stringified);
-                const attachment = new AttachmentBuilder(buffer).setName("data.json");
-                await interaction.editReply({
-                    embeds: [
-                        new EmojiEmbed().setTitle("Data").setDescription(`Data for ${guild.name}`).setStatus("Success")
-                    ],
-                    components: [],
-                    files: [attachment]
-                });
-            } else if (i.customId === "purge") {
-                if (!await confirm(interaction)) {
-                    await interaction.editReply({
-                        embeds: [
-                            new EmojiEmbed()
-                            .setTitle("No changes were made")
-                            .setStatus("Danger")
-                        ],
-                        components: []
-                    });
-                    return;
-                }
-                await client.database.guilds.delete(GuildID);
-                await client.database.history.delete(GuildID);
-                await client.database.notes.delete(GuildID);
-                await client.database.transcripts.deleteAll(GuildID);
-                await interaction.editReply({
-                    embeds: [
-                        new EmojiEmbed()
+                return;
+            }
+            await client.database.guilds.delete(GuildID);
+            await client.database.history.delete(GuildID);
+            await client.database.notes.delete(GuildID);
+            await client.database.transcripts.deleteAll(GuildID);
+            await interaction.editReply({
+                embeds: [
+                    new EmojiEmbed()
                         .setTitle("Purge")
                         .setDescription(`Deleted data for ${guild.name}`)
                         .setStatus("Success")
                         .setEmoji("SETTINGS.STATS.GREEN")
-                    ],
-                    components: []
-                });
-            } else if (i.customId === "cache") {
-                await i.deferUpdate();
-                await client.memory.forceUpdate(guild.id);
-                await interaction.editReply({
+                ],
+                components: []
+            });
+        } else if (i.customId === "cache") {
+            await i.deferUpdate();
+            await client.memory.forceUpdate(guild.id);
+            await interaction.editReply({
                 embeds: [
                     new EmojiEmbed()
                         .setTitle("Cache")
diff --git a/src/commands/nucleus/suggest.ts b/src/commands/nucleus/suggest.ts
index 44926c7..c1f0312 100644
--- a/src/commands/nucleus/suggest.ts
+++ b/src/commands/nucleus/suggest.ts
@@ -1,92 +1,107 @@
 import { LoadingEmbed } from "../../utils/defaults.js";
-import Discord, { ActionRowBuilder, ButtonBuilder, ButtonStyle, CommandInteraction, ModalBuilder, TextInputBuilder, TextInputStyle } from "discord.js";
+import Discord, {
+    ActionRowBuilder,
+    ButtonBuilder,
+    ButtonStyle,
+    CommandInteraction,
+    ModalBuilder,
+    TextInputBuilder,
+    TextInputStyle
+} from "discord.js";
 import type { SlashCommandSubcommandBuilder } from "discord.js";
 import confirmationMessage from "../../utils/confirmationMessage.js";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import client from "../../utils/client.js";
-import config from "../../config/main.js"
+import config from "../../config/main.js";
 import _ from "lodash";
 
 const command = (builder: SlashCommandSubcommandBuilder) =>
-    builder
-        .setName("suggest")
-        .setDescription("Sends a suggestion to the developers")
+    builder.setName("suggest").setDescription("Sends a suggestion to the developers");
 
 const callback = async (interaction: CommandInteraction): Promise<void> => {
     await interaction.guild?.members.fetch(interaction.member!.user.id);
     await interaction.reply({ embeds: LoadingEmbed, ephemeral: true });
     let closed = false;
-    let suggestionTitle: string | null = null
+    let suggestionTitle: string | null = null;
     let suggestionDesc: string | null = null;
     do {
         const modal = new ModalBuilder()
             .setTitle("Suggestion")
             .setComponents(
-                new ActionRowBuilder<TextInputBuilder>()
-                    .addComponents(
-                        new TextInputBuilder()
-                            .setLabel("Suggestion Title")
-                            .setRequired(false)
-                            .setStyle(TextInputStyle.Short)
-                            .setCustomId("suggestionTitle")
-                            .setPlaceholder("Summarize your suggestion in 1 sentence...")
-                            .setMaxLength(256)
-                    ),
-                new ActionRowBuilder<TextInputBuilder>()
-                    .addComponents(
-                        new TextInputBuilder()
-                            .setLabel("Suggestion Description")
-                            .setCustomId("suggestionDesc")
-                            .setStyle(TextInputStyle.Paragraph)
-                            .setRequired(true)
-                            .setPlaceholder("Put the full details of your suggestion here...")
-                            .setMinLength(50)
-                    ),
-            )
-        const o: {suggestionDesc?: string, suggestionTitle?: string} = {};
-        if(suggestionTitle) {
+                new ActionRowBuilder<TextInputBuilder>().addComponents(
+                    new TextInputBuilder()
+                        .setLabel("Suggestion Title")
+                        .setRequired(false)
+                        .setStyle(TextInputStyle.Short)
+                        .setCustomId("suggestionTitle")
+                        .setPlaceholder("Summarize your suggestion in 1 sentence...")
+                        .setMaxLength(256)
+                ),
+                new ActionRowBuilder<TextInputBuilder>().addComponents(
+                    new TextInputBuilder()
+                        .setLabel("Suggestion Description")
+                        .setCustomId("suggestionDesc")
+                        .setStyle(TextInputStyle.Paragraph)
+                        .setRequired(true)
+                        .setPlaceholder("Put the full details of your suggestion here...")
+                        .setMinLength(50)
+                )
+            );
+        const o: { suggestionDesc?: string; suggestionTitle?: string } = {};
+        if (suggestionTitle) {
             o.suggestionTitle = suggestionTitle;
             modal.components[0]!.components[0]!.setValue(suggestionTitle);
         }
-        if(suggestionDesc) {
-            o.suggestionDesc = suggestionDesc
+        if (suggestionDesc) {
+            o.suggestionDesc = suggestionDesc;
             modal.components[1]!.components[0]!.setValue(suggestionDesc);
-        };
+        }
         const confirmation = await new confirmationMessage(interaction)
             .setEmoji("ICONS.ADD")
             .setTitle("Suggest")
-            .setDescription(suggestionDesc ? (`Are you sure you want to send this suggestion?\n\n**Title ${suggestionTitle ? "" : "(*Placeholder*)"}:**\n> ${suggestionTitle ? suggestionTitle : `${suggestionDesc.substring(0, 70)}`}\n\n**Suggestion:**\n> ${suggestionDesc}`) : "Please enter your suggestion below.")
+            .setDescription(
+                suggestionDesc
+                    ? `Are you sure you want to send this suggestion?\n\n**Title ${
+                          suggestionTitle ? "" : "(*Placeholder*)"
+                      }:**\n> ${
+                          suggestionTitle ? suggestionTitle : `${suggestionDesc.substring(0, 70)}`
+                      }\n\n**Suggestion:**\n> ${suggestionDesc}`
+                    : "Please enter your suggestion below."
+            )
             .addModal("Edit Suggestion", "ICONS.EDIT", "editSuggestion", _.cloneDeep(o), modal)
             .setColor("Success")
             .setInverted(true)
             .setFailedMessage("Your suggestion was deleted", "Success", "ICONS.ADD")
             .send(true);
-        if(confirmation.modals?.[0] && !_.isEqual(confirmation.modals[0].values, o)) {
+        if (confirmation.modals?.[0] && !_.isEqual(confirmation.modals[0].values, o)) {
             suggestionTitle = confirmation.modals[0].values["suggestionTitle"] as string | null;
             suggestionDesc = confirmation.modals[0].values["suggestionDesc"] as string | null;
             continue;
         }
-        if(confirmation.cancelled || confirmation.success === false) {
+        if (confirmation.cancelled || confirmation.success === false) {
             closed = true;
             return;
         }
         if (confirmation.success) {
             closed = true;
-        };
+        }
     } while (!closed);
-    if(!suggestionDesc) return;
+    if (!suggestionDesc) return;
     suggestionTitle = suggestionTitle ? suggestionTitle : `${suggestionDesc.substring(0, 70)}`;
     const channel = client.channels.cache.get(config.suggestionChannel) as Discord.TextChannel;
-    const m = await channel.send({ embeds: LoadingEmbed});
+    const m = await channel.send({ embeds: LoadingEmbed });
     const issue = await client.GitHub.rest.issues.create({
         owner: "ClicksMinutePer",
         repo: "Nucleus",
         title: suggestionTitle,
-        body: `Linked Suggestion in Private Developer Channel: [Message](${m.url})\n\n**Suggestion:**\n> ${
-            suggestionDesc.replaceAll("@", "@<!-- -->").replaceAll("/issues", "/issues<!-- -->").replaceAll("/pull", "/pull<!-- -->")
-        }\n\n`,
+        body: `Linked Suggestion in Private Developer Channel: [Message](${
+            m.url
+        })\n\n**Suggestion:**\n> ${suggestionDesc
+            .replaceAll("@", "@<!-- -->")
+            .replaceAll("/issues", "/issues<!-- -->")
+            .replaceAll("/pull", "/pull<!-- -->")}\n\n`,
         labels: ["🤖 Auto", "📝 Suggestion"]
-    })
+    });
     await m.edit({
         embeds: [
             new EmojiEmbed()
@@ -94,22 +109,28 @@
                 .setTitle(`Suggestion from ${interaction.user.tag} (${interaction.user.id})`)
                 .setDescription(`**Suggestion:**\n> ${suggestionDesc}\n\n`)
                 .setStatus("Success")
-                .setFooter({text: `${issue.data.number}`})
+                .setFooter({ text: `${issue.data.number}` })
         ],
         components: [
             new Discord.ActionRowBuilder<ButtonBuilder>().addComponents(
                 new ButtonBuilder().setCustomId("accept:Suggestion").setLabel("Accept").setStyle(ButtonStyle.Success),
                 new ButtonBuilder().setCustomId("deny:Suggestion").setLabel("Deny").setStyle(ButtonStyle.Danger),
                 new ButtonBuilder().setCustomId("close:Suggestion").setLabel("Close").setStyle(ButtonStyle.Secondary),
-                new ButtonBuilder().setCustomId("implemented:Suggestion").setLabel("Implemented").setStyle(ButtonStyle.Secondary),
-                new ButtonBuilder().setLabel(`Open Issue #${issue.data.number}`).setStyle(ButtonStyle.Link).setURL(`https://github.com/ClicksMinutePer/Nucleus/issues/${issue.data.number}`),
+                new ButtonBuilder()
+                    .setCustomId("implemented:Suggestion")
+                    .setLabel("Implemented")
+                    .setStyle(ButtonStyle.Secondary),
+                new ButtonBuilder()
+                    .setLabel(`Open Issue #${issue.data.number}`)
+                    .setStyle(ButtonStyle.Link)
+                    .setURL(`https://github.com/ClicksMinutePer/Nucleus/issues/${issue.data.number}`)
             ),
             new Discord.ActionRowBuilder<ButtonBuilder>().addComponents(
                 new ButtonBuilder().setCustomId("lock:Suggestion").setLabel("Lock").setStyle(ButtonStyle.Danger),
-                new ButtonBuilder().setCustomId("spam:Suggestion").setLabel("Mark as Spam").setStyle(ButtonStyle.Danger),
+                new ButtonBuilder().setCustomId("spam:Suggestion").setLabel("Mark as Spam").setStyle(ButtonStyle.Danger)
             )
         ]
-    })
+    });
     await interaction.editReply({
         embeds: [
             new EmojiEmbed()
diff --git a/src/commands/privacy.ts b/src/commands/privacy.ts
index 7fefa36..587a7bc 100644
--- a/src/commands/privacy.ts
+++ b/src/commands/privacy.ts
@@ -45,8 +45,8 @@
                     .setDescription(
                         "Nucleus scans content sent by users for malware and NSFW content\n" +
                             'Malware is detected using [ClamAV](https://clamav.net/), and the standard ClamAV database."\n' +
-                            'NSFW detection is provided by [NsfwJS](https://nsfwjs.com/), with a model provided by [GantMan](https://github.com/GantMan/nsfw_model/releases/tag/1.1.0)\n\n' +
-                            'All data is processed on our servers and is not processed by a 3rd party.'
+                            "NSFW detection is provided by [NsfwJS](https://nsfwjs.com/), with a model provided by [GantMan](https://github.com/GantMan/nsfw_model/releases/tag/1.1.0)\n\n" +
+                            "All data is processed on our servers and is not processed by a 3rd party."
                     )
                     .setEmoji("NUCLEUS.LOGO")
                     .setStatus("Danger")
diff --git a/src/commands/settings/automod.ts b/src/commands/settings/automod.ts
index 68454e4..471af80 100644
--- a/src/commands/settings/automod.ts
+++ b/src/commands/settings/automod.ts
@@ -718,7 +718,7 @@
             .setEmoji("GUILD.SETTINGS.GREEN")
             .setFooter({
                 text: unsavedChanges ? "No changes made" : "Changes not saved"
-            });;
+            });
 
         await interaction.editReply({ embeds: [embed], components: [menu, allowedMenu, buttons] });
 
@@ -1047,11 +1047,14 @@
 
     let closed = false;
 
-
     let current = _.cloneDeep(config);
     do {
         const button = new ActionRowBuilder<ButtonBuilder>().addComponents(
-            new ButtonBuilder().setCustomId("save").setLabel("Save").setStyle(ButtonStyle.Success).setDisabled(_.isEqual(config, current))
+            new ButtonBuilder()
+                .setCustomId("save")
+                .setLabel("Save")
+                .setStyle(ButtonStyle.Success)
+                .setDisabled(_.isEqual(config, current))
         );
         const selectMenu = new ActionRowBuilder<StringSelectMenuBuilder>().addComponents(
             new StringSelectMenuBuilder()
@@ -1116,7 +1119,7 @@
             continue;
         }
         await i.deferUpdate();
-        if(i.isButton()) {
+        if (i.isButton()) {
             await client.database.guilds.write(interaction.guild.id, { filters: current });
             await client.memory.forceUpdate(interaction.guild.id);
             config = current;
diff --git a/src/config/format.ts b/src/config/format.ts
index da1815c..042d173 100644
--- a/src/config/format.ts
+++ b/src/config/format.ts
@@ -131,7 +131,7 @@
     }
     if (walkthrough && !(json["mongoUrl"] ?? false)) json["mongoUrl"] = "mongodb://127.0.0.1:27017";
     if (!((json["baseUrl"] as string | undefined) ?? "").endsWith("/")) (json["baseUrl"] as string) += "/";
-    const localhost = "127.0.0.1"
+    const localhost = "127.0.0.1";
     json["mongoUrl"] = (json["mongoUrl"]! as string).replace("localhost", localhost);
     json["baseUrl"] = (json["baseUrl"]! as string).replace("localhost", localhost);
     json["mongoOptions"] = {
@@ -145,7 +145,7 @@
         socket: json["clamAVSocket"] as string | undefined,
         host: json["clamAVHost"] as string | undefined,
         port: json["clamAVPort"] as number | undefined
-    }
+    };
 
     fs.writeFileSync("./src/config/main.ts", "export default " + JSON.stringify(json, null, 4) + ";");
 
diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts
index e27ee69..9d3dceb 100644
--- a/src/events/interactionCreate.ts
+++ b/src/events/interactionCreate.ts
@@ -4,7 +4,18 @@
 import close from "../actions/tickets/delete.js";
 import createTranscript from "../premium/createTranscript.js";
 
-import { ActionRowBuilder, ButtonBuilder, ButtonInteraction, ButtonStyle, Interaction, InteractionEditReplyOptions, ModalBuilder, ModalSubmitInteraction, TextInputBuilder, TextInputStyle } from "discord.js";
+import {
+    ActionRowBuilder,
+    ButtonBuilder,
+    ButtonInteraction,
+    ButtonStyle,
+    Interaction,
+    InteractionEditReplyOptions,
+    ModalBuilder,
+    ModalSubmitInteraction,
+    TextInputBuilder,
+    TextInputStyle
+} from "discord.js";
 import type { NucleusClient } from "../utils/client.js";
 import EmojiEmbed from "../utils/generateEmojiEmbed.js";
 
@@ -28,7 +39,10 @@
 async function interactionCreate(interaction: Interaction) {
     if (interaction.isButton()) {
         if (interaction.customId.endsWith(":Suggestion")) {
-            const value = interaction.customId.startsWith("accept") || interaction.customId.startsWith("implement") ? true : false
+            const value =
+                interaction.customId.startsWith("accept") || interaction.customId.startsWith("implement")
+                    ? true
+                    : false;
             return await modifySuggestion(interaction, value);
         }
         switch (interaction.customId) {
@@ -88,10 +102,7 @@
     const modal = new ModalBuilder()
         .addComponents(
             new ActionRowBuilder<TextInputBuilder>().addComponents(
-                new TextInputBuilder()
-                    .setStyle(TextInputStyle.Paragraph)
-                    .setLabel(prompt)
-                    .setCustomId("typed")
+                new TextInputBuilder().setStyle(TextInputStyle.Paragraph).setLabel(prompt).setCustomId("typed")
             )
         )
         .setTitle("Reason")
@@ -108,74 +119,95 @@
     }
     await out.deferUpdate();
     return out.fields.getTextInputValue("typed");
-}
+};
 
 async function modifySuggestion(interaction: ButtonInteraction, accept: boolean) {
     const message = interaction.message;
     await message.fetch();
     if (message.embeds.length === 0) return;
     const embed = message.embeds[0]!;
-    const issueNum = embed.footer!.text
-    if(!issueNum) return;
+    const issueNum = embed.footer!.text;
+    if (!issueNum) return;
     const issue = {
         owner: "ClicksMinutePer",
         repo: "Nucleus",
         issue_number: parseInt(issueNum)
-    }
+    };
     let name = "Unknown";
     const components: InteractionEditReplyOptions["components"] = [];
-    switch(interaction.customId) {
+    switch (interaction.customId) {
         case "accept:Suggestion": {
             name = "Accepted";
             await interaction.deferUpdate();
-            await client.GitHub.rest.issues.createComment({...issue, body: "Suggestion accepted by " + interaction.user.tag});
-            components.push(new ActionRowBuilder<ButtonBuilder>().addComponents(
-                new ButtonBuilder().setCustomId("close:Suggestion").setLabel("Close").setStyle(ButtonStyle.Secondary),
-                new ButtonBuilder().setCustomId("implemented:Suggestion").setLabel("Implemented").setStyle(ButtonStyle.Secondary)
-            ))
+            await client.GitHub.rest.issues.createComment({
+                ...issue,
+                body: "Suggestion accepted by " + interaction.user.tag
+            });
+            components.push(
+                new ActionRowBuilder<ButtonBuilder>().addComponents(
+                    new ButtonBuilder()
+                        .setCustomId("close:Suggestion")
+                        .setLabel("Close")
+                        .setStyle(ButtonStyle.Secondary),
+                    new ButtonBuilder()
+                        .setCustomId("implemented:Suggestion")
+                        .setLabel("Implemented")
+                        .setStyle(ButtonStyle.Secondary)
+                )
+            );
             break;
         }
         case "deny:Suggestion": {
             name = "Denied";
             const reason = await getReason(interaction, "Reason for denial");
-            await client.GitHub.rest.issues.createComment({...issue, body: "Suggestion denied by " + interaction.user.tag + " for reason:\n>" + reason});
-            await client.GitHub.rest.issues.update({...issue, state: "closed", state_reason: "not_planned"});
+            await client.GitHub.rest.issues.createComment({
+                ...issue,
+                body: "Suggestion denied by " + interaction.user.tag + " for reason:\n>" + reason
+            });
+            await client.GitHub.rest.issues.update({ ...issue, state: "closed", state_reason: "not_planned" });
             // await client.GitHub.rest.issues.lock({...issue, lock_reason: "resolved"})
-            components.push(new ActionRowBuilder<ButtonBuilder>().addComponents(
-                new ButtonBuilder().setCustomId("lock:Suggestion").setLabel("Lock").setStyle(ButtonStyle.Danger)
-            ))
+            components.push(
+                new ActionRowBuilder<ButtonBuilder>().addComponents(
+                    new ButtonBuilder().setCustomId("lock:Suggestion").setLabel("Lock").setStyle(ButtonStyle.Danger)
+                )
+            );
             break;
         }
         case "close:Suggestion": {
             name = "Closed";
             const reason = await getReason(interaction, "Reason for closing");
-            await client.GitHub.rest.issues.createComment({...issue, body: "Suggestion closed by " + interaction.user.tag + " for reason:\n>" + reason});
-            await client.GitHub.rest.issues.update({...issue, state: "closed"});
+            await client.GitHub.rest.issues.createComment({
+                ...issue,
+                body: "Suggestion closed by " + interaction.user.tag + " for reason:\n>" + reason
+            });
+            await client.GitHub.rest.issues.update({ ...issue, state: "closed" });
             // await client.GitHub.rest.issues.lock({...issue})
-            components.push(new ActionRowBuilder<ButtonBuilder>().addComponents(
-                new ButtonBuilder().setCustomId("lock:Suggestion").setLabel("Lock").setStyle(ButtonStyle.Danger)
-            ))
+            components.push(
+                new ActionRowBuilder<ButtonBuilder>().addComponents(
+                    new ButtonBuilder().setCustomId("lock:Suggestion").setLabel("Lock").setStyle(ButtonStyle.Danger)
+                )
+            );
             break;
         }
         case "implement:Suggestion": {
             name = "Implemented";
             await interaction.deferUpdate();
-            await client.GitHub.rest.issues.createComment({...issue, body: "Suggestion implemented"});
-            await client.GitHub.rest.issues.update({...issue, state: "closed", state_reason: "completed"});
-            await client.GitHub.rest.issues.lock({...issue, lock_reason: "resolved"})
+            await client.GitHub.rest.issues.createComment({ ...issue, body: "Suggestion implemented" });
+            await client.GitHub.rest.issues.update({ ...issue, state: "closed", state_reason: "completed" });
+            await client.GitHub.rest.issues.lock({ ...issue, lock_reason: "resolved" });
             break;
         }
         case "lock:Suggestion": {
             name = "Locked";
             await interaction.deferUpdate();
-            await client.GitHub.rest.issues.lock({...issue});
+            await client.GitHub.rest.issues.lock({ ...issue });
             break;
         }
         case "spam:Suggestion": {
             name = "Marked as Spam";
             await interaction.deferUpdate();
-            await client.GitHub.rest.issues.update({...issue, state: "closed", state_reason: "not_planned"});
-            await client.GitHub.rest.issues.lock({...issue, lock_reason: "spam"})
+            await client.GitHub.rest.issues.update({ ...issue, state: "closed", state_reason: "not_planned" });
+            await client.GitHub.rest.issues.lock({ ...issue, lock_reason: "spam" });
             break;
         }
     }
@@ -189,7 +221,7 @@
         .setDescription(embed!.description!)
         .setFields({
             name: name + " by",
-            value: interaction.user.tag,
+            value: interaction.user.tag
         })
         .setStatus(newcolor)
         .setFooter(embed!.footer);
diff --git a/src/utils/confirmationMessage.ts b/src/utils/confirmationMessage.ts
index f1229eb..0e4a9b4 100644
--- a/src/utils/confirmationMessage.ts
+++ b/src/utils/confirmationMessage.ts
@@ -106,7 +106,13 @@
         this.reason = reason;
         return this;
     }
-    addModal(buttonText: string, emoji: string, customId: string, current: Record<string, string>, modal: Discord.ModalBuilder) {
+    addModal(
+        buttonText: string,
+        emoji: string,
+        customId: string,
+        current: Record<string, string>,
+        modal: Discord.ModalBuilder
+    ) {
         modal.setCustomId(customId);
         this.modals.push({ buttonText, emoji, customId, modal, values: current });
         return this;
