diff --git a/src/commands/nucleus/premium.ts b/src/commands/nucleus/premium.ts
index 5fe6d88..a3f1368 100644
--- a/src/commands/nucleus/premium.ts
+++ b/src/commands/nucleus/premium.ts
@@ -89,7 +89,7 @@
         await i.deferUpdate();
         await client.database.premium.removePremium(interaction.user.id, i.values[0]!);
     } while (!closed);
-    await interaction.deleteReply()
+    await interaction.deleteReply();
 };
 
 const callback = async (interaction: CommandInteraction): Promise<void> => {
diff --git a/src/commands/settings/rolemenu.ts b/src/commands/settings/rolemenu.ts
index f887f64..dbdcb4c 100644
--- a/src/commands/settings/rolemenu.ts
+++ b/src/commands/settings/rolemenu.ts
@@ -218,7 +218,7 @@
             .setTitle(`${data.name}`)
             .setStatus("Success")
             .setDescription(
-                `**Description:**\n> ${data.description ?? '*No description set*'}\n\n` +
+                `**Description:**\n> ${data.description ?? "*No description set*"}\n\n` +
                     `**Min:** ${data.min}` +
                     (data.min === 0 ? " (Members will be given a skip button)" : "") +
                     "\n" +
@@ -487,18 +487,29 @@
                               .join("\n")
                         : "")
             );
-            if(currentObject.options.length > 0) {
+            if (currentObject.options.length > 0) {
                 pageSelect.addOptions(
                     currentObject.options.map((key: ObjectSchema, index) => {
                         return new StringSelectMenuOptionBuilder()
                             .setLabel(ellipsis(key.name, 50))
-                            .setDescription(ellipsis(key.description?.length ? (key.description.length > 0 ? key.description : "No description set") : "No description set", 50))
+                            .setDescription(
+                                ellipsis(
+                                    key.description?.length
+                                        ? key.description.length > 0
+                                            ? key.description
+                                            : "No description set"
+                                        : "No description set",
+                                    50
+                                )
+                            )
                             .setValue(index.toString());
                     })
                 );
             } else {
                 pageSelect.setDisabled(true);
-                pageSelect.addOptions(new StringSelectMenuOptionBuilder().setLabel("No role menu pages").setValue("none"));
+                pageSelect.addOptions(
+                    new StringSelectMenuOptionBuilder().setLabel("No role menu pages").setValue("none")
+                );
             }
         } else {
             page = Math.max(Math.min(page, currentObject.options.length), 0);
@@ -513,7 +524,16 @@
                 currentObject.options.map((key: ObjectSchema, index) => {
                     return new StringSelectMenuOptionBuilder()
                         .setLabel(ellipsis(key.name, 50))
-                        .setDescription(ellipsis(key.description?.length ? (key.description.length > 0 ? key.description : "No description set") : "No description set", 50))
+                        .setDescription(
+                            ellipsis(
+                                key.description?.length
+                                    ? key.description.length > 0
+                                        ? key.description
+                                        : "No description set"
+                                    : "No description set",
+                                50
+                            )
+                        )
                         .setValue(index.toString());
                 })
             );
