diff --git a/src/commands/server/buttons.ts b/src/commands/server/buttons.ts
index c89e481..f07f3ce 100644
--- a/src/commands/server/buttons.ts
+++ b/src/commands/server/buttons.ts
@@ -70,7 +70,7 @@
         buttons: ["createticket"],
         color: "RED"
     }
-]
+];
 
 export const callback = async (interaction: CommandInteraction): Promise<void> => {
     const m = await interaction.reply({
@@ -128,10 +128,10 @@
                             .setLabel(preset.title)
                             .setValue(i.toString())
                             .setDescription(preset.description)
-                            .setEmoji(getEmojiByName("COLORS." + preset.color, "id") as APIMessageComponentEmoji)
+                            .setEmoji(getEmojiByName("COLORS." + preset.color, "id") as APIMessageComponentEmoji);
                     })
                 )
-        )
+        );
 
         const buttonSelect = new ActionRowBuilder<StringSelectMenuBuilder>().addComponents(
             new StringSelectMenuBuilder()
@@ -297,7 +297,7 @@
             switch (i.customId) {
                 case "preset": {
                     const chosen = presetButtons[parseInt(i.values[0]!)]!;
-                    const newColor = colors[chosen.color!]!
+                    const newColor = colors[chosen.color!]!;
                     data = _.assign(data, chosen, { color: newColor });
                     break;
                 }
diff --git a/src/commands/settings/tracks.ts b/src/commands/settings/tracks.ts
index c81eeed..b79f54d 100644
--- a/src/commands/settings/tracks.ts
+++ b/src/commands/settings/tracks.ts
@@ -471,10 +471,10 @@
                 case "add": {
                     const newPage = await editTrack(i, m, roles);
                     if (_.isEqual(newPage, defaultTrackData)) break;
-                    if(!newPage) break;
-                    console.log(newPage)
+                    if (!newPage) break;
+                    console.log(newPage);
                     tracks.push(newPage);
-                    console.log(tracks)
+                    console.log(tracks);
                     page = tracks.length - 1;
                     break;
                 }
diff --git a/src/commands/user/track.ts b/src/commands/user/track.ts
index 92553ff..1ce05ee 100644
--- a/src/commands/user/track.ts
+++ b/src/commands/user/track.ts
@@ -98,7 +98,11 @@
             } roles from this track. `;
             conflictDropdown = [];
             const yourRoles = guild.members.cache.get(interaction.user.id)!.roles;
-            if ((roles.get(selected[0]!)!.position < yourRoles.highest.position && roles.get(selected[0]!)!.position < guild.members.me!.roles.highest.position!) || managed) {
+            if (
+                (roles.get(selected[0]!)!.position < yourRoles.highest.position &&
+                    roles.get(selected[0]!)!.position < guild.members.me!.roles.highest.position!) ||
+                managed
+            ) {
                 generated +=
                     "In order to promote or demote this user, you must select which role the member should keep.";
                 selected.forEach((role) => {
@@ -116,12 +120,12 @@
                         .setPlaceholder("Select a role to keep")
                 ];
             } else {
-                if(roles.get(selected[0]!)!.position >= yourRoles.highest.position) {
+                if (roles.get(selected[0]!)!.position >= yourRoles.highest.position) {
                     generated +=
                         "You don't have permission to manage one or more of the user's roles, and therefore can't select one to keep.";
                 } else {
                     generated +=
-                        "I don't have permission to manage one or more of the user's roles, and therefore can't select one to keep."
+                        "I don't have permission to manage one or more of the user's roles, and therefore can't select one to keep.";
                 }
             }
         } else {
diff --git a/src/reflex/scanners.ts b/src/reflex/scanners.ts
index b6860d1..1b9d740 100644
--- a/src/reflex/scanners.ts
+++ b/src/reflex/scanners.ts
@@ -283,31 +283,28 @@
                 .setCustomId(`mod:mute:${member.user.id}`)
                 .setLabel("Mute")
                 .setStyle(ButtonStyle.Primary),
-            new ButtonBuilder()
-                .setCustomId(`mod:kick:${member.user.id}`)
-                .setLabel("Kick")
-                .setStyle(ButtonStyle.Danger),
-            new ButtonBuilder()
-                .setCustomId(`mod:ban:${member.user.id}`)
-                .setLabel("Ban")
-                .setStyle(ButtonStyle.Danger)
-        ]
-        if (usernameCheck !== null || nicknameCheck !== null) buttons.concat([
-            new ButtonBuilder()
-                .setCustomId(`mod:nickname:${member.user.id}`)
-                .setLabel("Change Name")
-                .setStyle(ButtonStyle.Primary)
-        ])
-        if (avatarCheck || avatarTextCheck !== null) buttons.concat([
-            new ButtonBuilder()
-                .setURL(member.displayAvatarURL())
-                .setLabel("View Avatar")
-                .setStyle(ButtonStyle.Link)
-        ])
-        const components: ActionRowBuilder<ButtonBuilder>[] = []
+            new ButtonBuilder().setCustomId(`mod:kick:${member.user.id}`).setLabel("Kick").setStyle(ButtonStyle.Danger),
+            new ButtonBuilder().setCustomId(`mod:ban:${member.user.id}`).setLabel("Ban").setStyle(ButtonStyle.Danger)
+        ];
+        if (usernameCheck !== null || nicknameCheck !== null)
+            buttons.concat([
+                new ButtonBuilder()
+                    .setCustomId(`mod:nickname:${member.user.id}`)
+                    .setLabel("Change Name")
+                    .setStyle(ButtonStyle.Primary)
+            ]);
+        if (avatarCheck || avatarTextCheck !== null)
+            buttons.concat([
+                new ButtonBuilder().setURL(member.displayAvatarURL()).setLabel("View Avatar").setStyle(ButtonStyle.Link)
+            ]);
+        const components: ActionRowBuilder<ButtonBuilder>[] = [];
 
         for (let i = 0; i < buttons.length; i += 5) {
-            components.push(new ActionRowBuilder<ButtonBuilder>().addComponents(buttons.slice(i, Math.min(buttons.length - 1, i + 5))))
+            components.push(
+                new ActionRowBuilder<ButtonBuilder>().addComponents(
+                    buttons.slice(i, Math.min(buttons.length - 1, i + 5))
+                )
+            );
         }
 
         await channel.send({
