diff --git a/src/commands/settings/rolemenu.ts b/src/commands/settings/rolemenu.ts
index 333dbdc..1ca10a4 100644
--- a/src/commands/settings/rolemenu.ts
+++ b/src/commands/settings/rolemenu.ts
@@ -111,7 +111,7 @@
     m: Message,
     data: { name?: string; description?: string; bounds?: { min: number; max: number } },
     addBounds: boolean = false
-): Promise<[string | undefined, string | undefined, { min: number, max: number } | undefined]> => {
+): Promise<[string | undefined, string | undefined, { min: number; max: number } | undefined]> => {
     let { name, description, bounds } = data;
     const components = [
         new ActionRowBuilder<TextInputBuilder>().addComponents(
@@ -134,7 +134,7 @@
                 .setRequired(false)
                 .setMaxLength(100)
         )
-    ]
+    ];
     if (addBounds && bounds) {
         components.push(
             new ActionRowBuilder<TextInputBuilder>().addComponents(
@@ -157,14 +157,12 @@
                     .setRequired(true)
                     .setMaxLength(2)
             )
-        )
+        );
     }
     const modal = new ModalBuilder()
         .setTitle("Edit Name and Description")
         .setCustomId("editNameDescription")
-        .addComponents(
-            ...components
-        );
+        .addComponents(...components);
     const button = new ActionRowBuilder<ButtonBuilder>().addComponents(
         new ButtonBuilder()
             .setCustomId("back")
@@ -241,18 +239,20 @@
         const noRoles = data.options.length === 0;
         const previewSelect = configToDropdown(
             "Edit Roles",
-            data.description ? {
-                name: data.name,
-                description: data.description,
-                min: 1,
-                max: 1,
-                options: noRoles ? [{ name: "Role 1", description: null, role: "No role set" }] : data.options
-            } : {
-                name: data.name,
-                min: 1,
-                max: 1,
-                options: noRoles ? [{ name: "Role 1", description: null, role: "No role set" }] : data.options
-            },
+            data.description
+                ? {
+                      name: data.name,
+                      description: data.description,
+                      min: 1,
+                      max: 1,
+                      options: noRoles ? [{ name: "Role 1", description: null, role: "No role set" }] : data.options
+                  }
+                : {
+                      name: data.name,
+                      min: 1,
+                      max: 1,
+                      options: noRoles ? [{ name: "Role 1", description: null, role: "No role set" }] : data.options
+                  },
             undefined,
             noRoles
         );
@@ -301,7 +301,7 @@
                 case "edit": {
                     const [name, description, _bounds] = await editNameDescription(i, interaction, m, data);
                     data.name = name ? name : data.name;
-                    description ? data.description = description : null;
+                    description ? (data.description = description) : null;
                     break;
                 }
                 case "addRole": {
@@ -523,7 +523,9 @@
                         ? currentObject.options
                               .map((key: ObjectSchema) => {
                                   const crossOut = key.enabled ? "" : "~~";
-                                  return `> ${crossOut}**${key.name}:** ${key.description ?? "*No description set*"}${crossOut}`;
+                                  return `> ${crossOut}**${key.name}:** ${
+                                      key.description ?? "*No description set*"
+                                  }${crossOut}`;
                               })
                               .join("\n")
                         : "")
@@ -566,12 +568,17 @@
                             "id"
                         ) as APIMessageComponentEmoji
                     )
-            )
+            );
             embed.setDescription(
                 `**Currently Editing:** ${current.name}\n\n` +
                     `**Visible:** ${current.enabled ? `${tick} Yes` : `${cross} No`}\n\n` +
                     `**Description:**\n> ${current.description ?? "*No description set*"}\n` +
-                    `\n\n${createPageIndicator(Object.keys(currentObject.options).length, page - 1, false, Object.values(currentObject.options).map((o) => !(o.enabled ?? true)))}`
+                    `\n\n${createPageIndicator(
+                        Object.keys(currentObject.options).length,
+                        page - 1,
+                        false,
+                        Object.values(currentObject.options).map((o) => !(o.enabled ?? true))
+                    )}`
             );
 
             pageSelect.addOptions(
@@ -649,7 +656,7 @@
                 }
                 case "save": {
                     await client.database.guilds.write(interaction.guild.id, {
-                        "roleMenu": currentObject
+                        roleMenu: currentObject
                     });
                     modified = false;
                     await client.memory.forceUpdate(interaction.guild.id);
diff --git a/src/utils/createPageIndicator.ts b/src/utils/createPageIndicator.ts
index 557bbbe..0831c83 100644
--- a/src/utils/createPageIndicator.ts
+++ b/src/utils/createPageIndicator.ts
@@ -1,12 +1,19 @@
 import getEmojiByName from "./getEmojiByName.js";
 
-function pageIndicator(amount: number, selected: number, showDetails?: boolean, disabled?: boolean | string | boolean[]) {
+function pageIndicator(
+    amount: number,
+    selected: number,
+    showDetails?: boolean,
+    disabled?: boolean | string | boolean[]
+) {
     let out = "";
     // disabled = disabled ? "GRAY." : "";
     // If disabled is a string, make a list of booleans the same length as amount.
     if (!Array.isArray(disabled)) disabled = new Array(amount).fill(disabled);
     // If the length is wrong, fill extra with false
-    if (disabled.length !== amount) { disabled = disabled.concat(new Array(amount).fill(false)); }
+    if (disabled.length !== amount) {
+        disabled = disabled.concat(new Array(amount).fill(false));
+    }
     const grey = disabled.map((x) => (x ? "GRAY." : ""));
     if (amount === 1) {
         out += getEmojiByName("TRACKS.SINGLE." + grey[0] + (selected === 0 ? "ACTIVE" : "INACTIVE"));
