diff --git a/src/utils/client.ts b/src/utils/client.ts
index 43f8c5f..6899b90 100644
--- a/src/utils/client.ts
+++ b/src/utils/client.ts
@@ -6,6 +6,7 @@
 import EventScheduler from "../utils/eventScheduler.js";
 import type { RoleMenuSchema } from "../actions/roleMenu.js";
 import config from "../config/main.js";
+import { Octokit } from "octokit";
 
 class NucleusClient extends Client {
     logger = Logger;
@@ -24,6 +25,7 @@
         scanCache: ScanCache;
         transcripts: Transcript;
     };
+    GitHub = new Octokit({ auth: config.githubPAT });
     preloadPage: Record<string, { command: string; argument: string }> = {}; // e.g. { channelID: { command: privacy, page: 3}}
     commands: Record<
         string,
diff --git a/src/utils/confirmationMessage.ts b/src/utils/confirmationMessage.ts
index 59befe6..f1229eb 100644
--- a/src/utils/confirmationMessage.ts
+++ b/src/utils/confirmationMessage.ts
@@ -42,7 +42,7 @@
         emoji: string;
         customId: string;
         modal: Discord.ModalBuilder;
-        value: string | undefined;
+        values: Record<string, string>;
     }[] = [];
 
     constructor(interaction: CommandInteraction | ButtonInteraction) {
@@ -106,9 +106,9 @@
         this.reason = reason;
         return this;
     }
-    addModal(buttonText: string, emoji: string, customId: string, current: 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, value: current });
+        this.modals.push({ buttonText, emoji, customId, modal, values: current });
         return this;
     }
     async send(editOnly?: boolean): Promise<{
@@ -121,7 +121,7 @@
             emoji: string;
             customId: string;
             modal: Discord.ModalBuilder;
-            value: string | undefined;
+            values: Record<string, string>;
         }[];
     }> {
         let cancelled = false;
@@ -131,19 +131,19 @@
 
         while (!cancelled && success === undefined && !returnComponents && !newReason) {
             const fullComponents = [
-                new Discord.ButtonBuilder()
+                new ButtonBuilder()
                     .setCustomId("yes")
                     .setLabel("Confirm")
                     .setStyle(this.inverted ? ButtonStyle.Success : ButtonStyle.Danger)
                     .setEmoji(getEmojiByName("CONTROL.TICK", "id")),
-                new Discord.ButtonBuilder()
+                new ButtonBuilder()
                     .setCustomId("no")
                     .setLabel("Cancel")
-                    .setStyle(ButtonStyle.Secondary)
+                    .setStyle(ButtonStyle.Danger)
                     .setEmoji(getEmojiByName("CONTROL.CROSS", "id"))
             ];
             Object.entries(this.customButtons).forEach(([k, v]) => {
-                const button = new Discord.ButtonBuilder()
+                const button = new ButtonBuilder()
                     .setCustomId(k)
                     .setLabel(v.title)
                     .setStyle(v.active ? ButtonStyle.Success : ButtonStyle.Primary)
@@ -153,7 +153,7 @@
             });
             for (const modal of this.modals) {
                 fullComponents.push(
-                    new Discord.ButtonBuilder()
+                    new ButtonBuilder()
                         .setCustomId(modal.customId)
                         .setLabel(modal.buttonText)
                         .setStyle(ButtonStyle.Primary)
@@ -163,7 +163,7 @@
             }
             if (this.reason !== null)
                 fullComponents.push(
-                    new Discord.ButtonBuilder()
+                    new ButtonBuilder()
                         .setCustomId("reason")
                         .setLabel("Edit Reason")
                         .setStyle(ButtonStyle.Primary)
@@ -174,7 +174,7 @@
             for (let i = 0; i < fullComponents.length; i += 5) {
                 components.push(
                     new ActionRowBuilder<
-                        | Discord.ButtonBuilder
+                        | ButtonBuilder
                         | Discord.StringSelectMenuBuilder
                         | Discord.RoleSelectMenuBuilder
                         | Discord.UserSelectMenuBuilder
@@ -272,7 +272,7 @@
                             .setEmoji(this.emoji)
                     ],
                     components: [
-                        new ActionRowBuilder<Discord.ButtonBuilder>().addComponents(
+                        new ActionRowBuilder<ButtonBuilder>().addComponents(
                             new ButtonBuilder()
                                 .setLabel("Back")
                                 .setEmoji(getEmojiByName("CONTROL.LEFT", "id"))
@@ -322,7 +322,7 @@
                             .setEmoji(this.emoji)
                     ],
                     components: [
-                        new ActionRowBuilder<Discord.ButtonBuilder>().addComponents(
+                        new ActionRowBuilder<ButtonBuilder>().addComponents(
                             new ButtonBuilder()
                                 .setLabel("Back")
                                 .setEmoji(getEmojiByName("CONTROL.LEFT", "id"))
@@ -350,7 +350,9 @@
                     continue;
                 }
                 if (out instanceof ModalSubmitInteraction) {
-                    chosenModal!.value = out.fields.getTextInputValue("default");
+                    out.fields.fields.forEach((f, k) => {
+                        chosenModal!.values[k] = f.value;
+                    });
                 }
                 returnComponents = true;
                 continue;
