diff --git a/src/commands/nucleus/suggest.ts b/src/commands/nucleus/suggest.ts
index 0c596ff..238e7d5 100644
--- a/src/commands/nucleus/suggest.ts
+++ b/src/commands/nucleus/suggest.ts
@@ -3,55 +3,55 @@
 import { WrappedCheck } from "jshaiku";
 import confirmationMessage from "../../utils/confirmationMessage.js";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
-import client from "../../utils/client.js"
+import client from "../../utils/client.js";
 
 const command = (builder: SlashCommandSubcommandBuilder) =>
     builder
-    .setName("suggest")
-    .setDescription("Sends a suggestion to the developers")
-    .addStringOption(option => option.setName("suggestion").setDescription("The suggestion to send").setRequired(true))
+        .setName("suggest")
+        .setDescription("Sends a suggestion to the developers")
+        .addStringOption(option => option.setName("suggestion").setDescription("The suggestion to send").setRequired(true));
 
 const callback = async (interaction: CommandInteraction): Promise<any> => {
-    const { renderUser } = client.logger
-    let suggestion = interaction.options.getString("suggestion");
-    let confirmation = await new confirmationMessage(interaction)
+    const { renderUser } = client.logger;
+    const suggestion = interaction.options.getString("suggestion");
+    const confirmation = await new confirmationMessage(interaction)
         .setEmoji("ICONS.OPP.ADD")
         .setTitle("Suggest")
         .setDescription(`**Suggestion:**\n> ${suggestion}\n`
-        + `Your username and ID will also be sent with your suggestion.\n\nAre you sure you want to send this suggestion?`)
+        + "Your username and ID will also be sent with your suggestion.\n\nAre you sure you want to send this suggestion?")
         .setColor("Danger")
         .setInverted(true)
-    .send()
-    if (confirmation.cancelled) return
+        .send();
+    if (confirmation.cancelled) return;
     if (confirmation.success) {
-        await (client.channels.cache.get('955161206459600976') as Discord.TextChannel).send({
+        await (client.channels.cache.get("955161206459600976") as Discord.TextChannel).send({
             embeds: [
                 new EmojiEmbed()
-                    .setTitle(`Suggestion`)
+                    .setTitle("Suggestion")
                     .setDescription(`**From:** ${renderUser(interaction.member.user)}\n**Suggestion:**\n> ${suggestion}`)
                     .setStatus("Danger")
                     .setEmoji("NUCLEUS.LOGO")
             ]
-        })
+        });
         await interaction.editReply({embeds: [new EmojiEmbed()
             .setEmoji("ICONS.ADD")
-            .setTitle(`Suggest`)
+            .setTitle("Suggest")
             .setDescription("Your suggestion was sent successfully")
             .setStatus("Success")
-        ], components: []})
+        ], components: []});
     } else {
         await interaction.editReply({embeds: [new EmojiEmbed()
             .setEmoji("ICONS.OPP.ADD")
-            .setTitle(`Suggest`)
+            .setTitle("Suggest")
             .setDescription("No changes were made")
             .setStatus("Danger")
-        ], components: []})
+        ], components: []});
     }
-}
+};
 
 const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
     return true;
-}
+};
 
 export { command };
 export { callback };
