diff --git a/src/Unfinished/all.ts b/src/Unfinished/all.ts
index 453a467..1c6ce20 100644
--- a/src/Unfinished/all.ts
+++ b/src/Unfinished/all.ts
@@ -23,11 +23,7 @@
     data: object;
     checkFunction: (member) => boolean;
     inverted = false;
-    constructor(
-        name: (data) => string | string,
-        data: object,
-        check: (member) => boolean
-    ) {
+    constructor(name: (data) => string | string, data: object, check: (member) => boolean) {
         if (typeof name === "function") {
             this.name = name(data);
         } else {
@@ -64,10 +60,7 @@
             render: "joined",
             before: (date) =>
                 new Filter(
-                    (_data) =>
-                        `Joined server before <t:${Math.round(
-                            date.getTime() / 1000
-                        )}:D>`,
+                    (_data) => `Joined server before <t:${Math.round(date.getTime() / 1000)}:D>`,
                     { date: date, type: Date, render: "before" },
                     (member) => {
                         return member.joinedTimestamp < date.getTime();
@@ -116,10 +109,7 @@
             render: "created",
             before: (date) =>
                 new Filter(
-                    (_data) =>
-                        `Account created before <t:${Math.round(
-                            date.getTime() / 1000
-                        )}:D>`,
+                    (_data) => `Account created before <t:${Math.round(date.getTime() / 1000)}:D>`,
                     { date: date, type: Date, render: "before" },
                     (member) => {
                         return member.user.createdTimestamp < date.getTime();
@@ -167,9 +157,7 @@
     }
 };
 
-const callback = async (
-    interaction: CommandInteraction
-): Promise<void | unknown> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
     await interaction.reply({
         embeds: LoadingEmbed,
         ephemeral: true,
@@ -215,29 +203,20 @@
                 new EmojiEmbed()
                     .setTitle("Role all")
                     .setDescription(
-                        (all
-                            ? "All of the following must be true:"
-                            : "Any of the following must be true") +
+                        (all ? "All of the following must be true:" : "Any of the following must be true") +
                             "\n" +
                             filters
                                 .map((f) => {
                                     count++;
                                     return (
-                                        (count === 1
-                                            ? getEmojiByName("ICONS.FILTER")
-                                            : all
-                                            ? "**and** "
-                                            : "**or** ") +
+                                        (count === 1 ? getEmojiByName("ICONS.FILTER") : all ? "**and** " : "**or** ") +
                                         (f.inverted ? "**not** " : "") +
                                         `${f.name}`
                                     );
                                 })
                                 .join("\n") +
                             "\n\n" +
-                            `This will affect ${addPlural(
-                                affected.length,
-                                "member"
-                            )}`
+                            `This will affect ${addPlural(affected.length, "member")}`
                     )
                     .setEmoji("GUILD.ROLES.CREATE")
                     .setStatus("Success")
@@ -261,21 +240,13 @@
                         .setLabel("Apply")
                         .setStyle("PRIMARY")
                         .setCustomId("apply")
-                        .setEmoji(
-                            client.emojis.cache.get(
-                                getEmojiByName("CONTROL.TICK", "id")
-                            )
-                        )
+                        .setEmoji(client.emojis.cache.get(getEmojiByName("CONTROL.TICK", "id")))
                         .setDisabled(affected.length === 0),
                     new MessageButton()
                         .setLabel("Add filter")
                         .setStyle("PRIMARY")
                         .setCustomId("add")
-                        .setEmoji(
-                            client.emojis.cache.get(
-                                getEmojiByName("ICONS.FILTER", "id")
-                            )
-                        )
+                        .setEmoji(client.emojis.cache.get(getEmojiByName("ICONS.FILTER", "id")))
                         .setDisabled(filters.length >= 25)
                 ])
             ]
@@ -285,19 +256,14 @@
     return;
 };
 
-const check = async (
-    interaction: CommandInteraction,
-    _defaultCheck: WrappedCheck
-) => {
+const check = async (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
     const member = interaction.member as GuildMember;
     const me = interaction.guild.me!;
-    if (!me.permissions.has("MANAGE_ROLES"))
-        throw "I do not have the *Manage Roles* permission";
+    if (!me.permissions.has("MANAGE_ROLES")) throw "I do not have the *Manage Roles* permission";
     // Allow the owner to role anyone
     if (member.id === interaction.guild.ownerId) return true;
     // Check if the user has manage_roles permission
-    if (!member.permissions.has("MANAGE_ROLES"))
-        throw "You do not have the *Manage Roles* permission";
+    if (!member.permissions.has("MANAGE_ROLES")) throw "You do not have the *Manage Roles* permission";
     // Allow role
     return true;
 };
diff --git a/src/Unfinished/categorisationTest.ts b/src/Unfinished/categorisationTest.ts
index 8c25eb2..2da2be3 100644
--- a/src/Unfinished/categorisationTest.ts
+++ b/src/Unfinished/categorisationTest.ts
@@ -1,11 +1,5 @@
 import { LoadingEmbed } from "../utils/defaultEmbeds.js";
-import {
-    CommandInteraction,
-    GuildChannel,
-    MessageActionRow,
-    MessageButton,
-    MessageSelectMenu
-} from "discord.js";
+import { CommandInteraction, GuildChannel, MessageActionRow, MessageButton, MessageSelectMenu } from "discord.js";
 import { SlashCommandBuilder } from "@discordjs/builders";
 // @ts-expect-error
 import type { WrappedCheck } from "jshaiku";
@@ -14,14 +8,10 @@
 import addPlural from "../utils/plurals.js";
 import getEmojiByName from "../utils/getEmojiByName.js";
 
-const command = new SlashCommandBuilder()
-    .setName("categorise")
-    .setDescription("Categorises your servers channels");
+const command = new SlashCommandBuilder().setName("categorise").setDescription("Categorises your servers channels");
 
 const callback = async (interaction: CommandInteraction): Promise<unknown> => {
-    const channels = interaction.guild.channels.cache.filter(
-        (c) => c.type !== "GUILD_CATEGORY"
-    );
+    const channels = interaction.guild.channels.cache.filter((c) => c.type !== "GUILD_CATEGORY");
     const categorised = {};
     await interaction.reply({ embeds: LoadingEmbed, ephemeral: true });
     const predicted = {};
@@ -50,10 +40,7 @@
     for (const c of channels) {
         // convert channel to a channel if its a string
         let channel: string | GuildChannel;
-        if (typeof c === "string")
-            channel = interaction.guild.channels.cache.get(
-                channel as string
-            ).id;
+        if (typeof c === "string") channel = interaction.guild.channels.cache.get(channel as string).id;
         else channel = (c[0] as unknown as GuildChannel).id;
         console.log(channel);
         if (!predicted[channel]) predicted[channel] = [];
@@ -63,10 +50,7 @@
                     .setTitle("Categorise")
                     .setDescription(
                         `Select all types that apply to <#${channel}>.\n\n` +
-                            `${addPlural(
-                                predicted[channel].length,
-                                "Suggestion"
-                            )}: ${predicted[channel].join(", ")}`
+                            `${addPlural(predicted[channel].length, "Suggestion")}: ${predicted[channel].join(", ")}`
                     )
                     .setEmoji("CHANNEL.CATEGORY.CREATE")
                     .setStatus("Success")
@@ -77,9 +61,7 @@
                         .setCustomId("selected")
                         .setMaxValues(Object.keys(types).length)
                         .setMinValues(1)
-                        .setPlaceholder(
-                            "Select all types that apply to this channel"
-                        )
+                        .setPlaceholder("Select all types that apply to this channel")
                         .setOptions(
                             Object.keys(types).map((type) => ({
                                 label: type,
@@ -93,20 +75,12 @@
                         .setCustomId("accept")
                         .setStyle("SUCCESS")
                         .setDisabled(predicted[channel].length === 0)
-                        .setEmoji(
-                            client.emojis.cache.get(
-                                getEmojiByName("ICONS.TICK", "id")
-                            )
-                        ),
+                        .setEmoji(client.emojis.cache.get(getEmojiByName("ICONS.TICK", "id"))),
                     new MessageButton()
                         .setLabel('Use "Other"')
                         .setCustomId("reject")
                         .setStyle("SECONDARY")
-                        .setEmoji(
-                            client.emojis.cache.get(
-                                getEmojiByName("ICONS.CROSS", "id")
-                            )
-                        )
+                        .setEmoji(client.emojis.cache.get(getEmojiByName("ICONS.CROSS", "id")))
                 ])
             ]
         });
@@ -122,10 +96,9 @@
                         .setStatus("Danger")
                         .setDescription(
                             `Select all types that apply to <#${channel}>.\n\n` +
-                                `${addPlural(
-                                    predicted[channel].length,
-                                    "Suggestion"
-                                )}: ${predicted[channel].join(", ")}`
+                                `${addPlural(predicted[channel].length, "Suggestion")}: ${predicted[channel].join(
+                                    ", "
+                                )}`
                         )
                         .setFooter({ text: "Message timed out" })
                 ]
@@ -147,10 +120,7 @@
     console.log(categorised);
 };
 
-const check = (
-    _interaction: CommandInteraction,
-    _defaultCheck: WrappedCheck
-) => {
+const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
     return true;
 };
 
