diff --git a/src/actions/tickets/delete.ts b/src/actions/tickets/delete.ts
index 7e52458..769bc32 100644
--- a/src/actions/tickets/delete.ts
+++ b/src/actions/tickets/delete.ts
@@ -179,7 +179,7 @@
             } catch (e) {
                 console.error(e);
             }
-        };
+        }
     } else {
         // For threads, the name is the users name, id, then the word Active
         const channel = tickets as Discord.TextChannel;
@@ -191,7 +191,7 @@
             } catch (e) {
                 console.error(e);
             }
-        };
+        }
     }
     if (!deleted) return;
     const { log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
diff --git a/src/events/guildMemberUpdate.ts b/src/events/guildMemberUpdate.ts
index 05b70b7..537a483 100644
--- a/src/events/guildMemberUpdate.ts
+++ b/src/events/guildMemberUpdate.ts
@@ -164,11 +164,15 @@
             }
         };
         await log(data);
-        await client.database.eventScheduler.schedule("naturalUnmute", after.communicationDisabledUntil?.toISOString()!, {
-            guild: after.guild.id,
-            user: after.id,
-            expires: after.communicationDisabledUntilTimestamp
-        });
+        await client.database.eventScheduler.schedule(
+            "naturalUnmute",
+            after.communicationDisabledUntil?.toISOString()!,
+            {
+                guild: after.guild.id,
+                user: after.id,
+                expires: after.communicationDisabledUntilTimestamp
+            }
+        );
     }
     if (
         after.communicationDisabledUntil === null &&
diff --git a/src/reflex/statsChannelUpdate.ts b/src/reflex/statsChannelUpdate.ts
index f2650a8..1b9379b 100644
--- a/src/reflex/statsChannelUpdate.ts
+++ b/src/reflex/statsChannelUpdate.ts
@@ -12,34 +12,43 @@
 export async function callback(user: User, guild: Guild) {
     guild = await client.guilds.fetch(guild.id);
     const config = await client.database.guilds.read(guild.id);
-    Object.entries(config.stats).forEach(([channel, props]) => void (async () => {
-        if ((props as PropSchema).enabled) {
-            let string = (props as PropSchema).name;
-            if (!string) return;
-            string = await convertCurlyBracketString(string, user!.id, user!.username, guild!.name, guild!.members);
-            let fetchedChannel;
-            try {
-                fetchedChannel = await guild.channels.fetch(channel);
-            } catch (e) {
-                fetchedChannel = null;
-            }
-            if (!fetchedChannel) {
-                const deleted = config.stats[channel];
-                await client.database.guilds.write(guild.id, null, `stats.${channel}`);
-                return singleNotify(
-                    "statsChannelDeleted",
-                    guild.id,
-                    `One or more of your stats channels have been deleted. You can use ${getCommandMentionByName(
-                        "settings/stats"
-                    )}.\n` + `The channels name was: ${deleted!.name}`,
-                    "Critical"
-                );
-            }
-            try {
-                await fetchedChannel.setName(string.slice(0, 100));
-            } catch (e) {
-                console.error(e);
-            }
-        }
-    })());
+    Object.entries(config.stats).forEach(
+        ([channel, props]) =>
+            void (async () => {
+                if ((props as PropSchema).enabled) {
+                    let string = (props as PropSchema).name;
+                    if (!string) return;
+                    string = await convertCurlyBracketString(
+                        string,
+                        user!.id,
+                        user!.username,
+                        guild!.name,
+                        guild!.members
+                    );
+                    let fetchedChannel;
+                    try {
+                        fetchedChannel = await guild.channels.fetch(channel);
+                    } catch (e) {
+                        fetchedChannel = null;
+                    }
+                    if (!fetchedChannel) {
+                        const deleted = config.stats[channel];
+                        await client.database.guilds.write(guild.id, null, `stats.${channel}`);
+                        return singleNotify(
+                            "statsChannelDeleted",
+                            guild.id,
+                            `One or more of your stats channels have been deleted. You can use ${getCommandMentionByName(
+                                "settings/stats"
+                            )}.\n` + `The channels name was: ${deleted!.name}`,
+                            "Critical"
+                        );
+                    }
+                    try {
+                        await fetchedChannel.setName(string.slice(0, 100));
+                    } catch (e) {
+                        console.error(e);
+                    }
+                }
+            })()
+    );
 }
diff --git a/src/utils/commandRegistration/register.ts b/src/utils/commandRegistration/register.ts
index 22c2fbd..d76617c 100644
--- a/src/utils/commandRegistration/register.ts
+++ b/src/utils/commandRegistration/register.ts
@@ -181,11 +181,19 @@
     client.on("interactionCreate", async (interaction: Interaction) => {
         if (interaction.isUserContextMenuCommand()) {
             const commandName = "contextCommands/user/" + interaction.commandName;
-            await execute(client.commands[commandName]![0]?.check, client.commands[commandName]![0]?.callback, interaction);
+            await execute(
+                client.commands[commandName]![0]?.check,
+                client.commands[commandName]![0]?.callback,
+                interaction
+            );
             return;
         } else if (interaction.isMessageContextMenuCommand()) {
             const commandName = "contextCommands/message/" + interaction.commandName;
-            await execute(client.commands[commandName]![0]?.check, client.commands[commandName]![0]?.callback, interaction);
+            await execute(
+                client.commands[commandName]![0]?.check,
+                client.commands[commandName]![0]?.callback,
+                interaction
+            );
             return;
         } else if (interaction.isAutocomplete()) {
             const commandName = interaction.commandName;
