diff --git a/CODEOWNERS b/CODEOWNERS
new file mode 100644
index 0000000..41f9571
--- /dev/null
+++ b/CODEOWNERS
@@ -0,0 +1,9 @@
+package.json @Minion3665
+tsconfig.json @Minion3665
+.prettierrc.json @Minion3665
+.prettierignore @Minion3665
+.eslintrc.json @Minion3665
+.eslintignore @Minion3665
+.editorconfig @Minion3665
+.github/ @Minion3665
+
diff --git a/src/utils/confirmationMessage.ts b/src/utils/confirmationMessage.ts
index a8c7ab4..58ab9d4 100644
--- a/src/utils/confirmationMessage.ts
+++ b/src/utils/confirmationMessage.ts
@@ -86,7 +86,12 @@
         components?: Record<string, CustomBoolean<unknown>>;
         newReason?: string;
     }> {
-        while (true) {
+        let cancelled = false;
+        let success: boolean | undefined = undefined;
+        let returnComponents = false;
+        let newReason = undefined;
+
+        while (!cancelled && success === undefined && !returnComponents && !newReason) {
             const fullComponents = [
                 new Discord.MessageButton()
                     .setCustomId("yes")
@@ -150,7 +155,8 @@
                     m = (await this.interaction.reply(object)) as unknown as Message;
                 }
             } catch {
-                return { cancelled: true };
+                cancelled = true;
+                continue;
             }
             let component;
             try {
@@ -159,7 +165,9 @@
                     time: 300000
                 });
             } catch (e) {
-                return { success: false, components: this.customButtons };
+                success = false;
+                returnComponents = true;
+                continue;
             }
             if (component.customId === "yes") {
                 component.deferUpdate();
@@ -171,10 +179,14 @@
                         console.log(e);
                     }
                 }
-                return { success: true, components: this.customButtons };
+                success = true;
+                returnComponents = true;
+                continue;
             } else if (component.customId === "no") {
                 component.deferUpdate();
-                return { success: false, components: this.customButtons };
+                success = false;
+                returnComponents = true;
+                continue;
             } else if (component.customId === "reason") {
                 await component.showModal(
                     new Discord.Modal()
@@ -221,24 +233,35 @@
                         (m) => m.customId === "reason"
                     );
                 } catch (e) {
-                    return { cancelled: true };
+                    cancelled = true;
+                    continue;
                 }
                 if (out === null) {
-                    return { cancelled: true };
+                    cancelled = true;
+                    continue;
                 }
                 if (out instanceof ModalSubmitInteraction) {
-                    return {
-                        newReason: out.fields.getTextInputValue("reason")
-                    };
+                    newReason = out.fields.getTextInputValue("reason");
+                    continue;
                 } else {
-                    return { components: this.customButtons };
+                    returnComponents = true;
+                    continue;
                 }
             } else {
                 component.deferUpdate();
                 this.customButtons[component.customId]!.active = !this.customButtons[component.customId]!.active;
-                return { components: this.customButtons };
+                returnComponents = true;
+                continue;
             }
         }
+        const returnValue: Awaited<ReturnType<typeof this.send>> = {};
+
+        if (returnComponents) returnValue.components = this.customButtons;
+        if (success !== undefined) returnValue.success = success;
+        if (cancelled) returnValue.cancelled = true;
+        if (newReason) returnValue.newReason = newReason;
+
+        return returnValue;
     }
 }
 
diff --git a/src/utils/specialTypes.ts b/src/utils/specialTypes.ts
new file mode 100644
index 0000000..93264d6
--- /dev/null
+++ b/src/utils/specialTypes.ts
@@ -0,0 +1,4 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
+export type AsyncReturnType<T extends (...args: any[]) => Promise<any>> = T extends (...args: any[]) => Promise<infer X>
+    ? X
+    : unknown;
