diff --git a/src/events/guildMemberUpdate.ts b/src/events/guildMemberUpdate.ts
index 41a22c1..34a52b8 100644
--- a/src/events/guildMemberUpdate.ts
+++ b/src/events/guildMemberUpdate.ts
@@ -2,6 +2,7 @@
 import type { NucleusClient } from "../utils/client.js";
 import type { LoggerOptions } from "../utils/log.js";
 import { generalException } from "../utils/createTemporaryStorage.js";
+import { doMemberChecks } from "../reflex/scanners.js";
 
 export const event = "guildMemberUpdate";
 
@@ -92,6 +93,7 @@
     if (!auditLog) return;
     if (auditLog.executor!.id === client.user!.id) return;
     if (before.nickname !== after.nickname) {
+        doMemberChecks(after, after.guild);
         await client.database.history.create(
             "nickname",
             after.guild.id,
diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts
index 4a8d941..3b0cd62 100644
--- a/src/events/interactionCreate.ts
+++ b/src/events/interactionCreate.ts
@@ -19,10 +19,7 @@
 
 async function errorMessage(interaction: ButtonInteraction, message: string) {
     await interaction.reply({
-        embeds: [new EmojiEmbed()
-            .setDescription(message)
-            .setStatus("Danger")
-        ],
+        embeds: [new EmojiEmbed().setDescription(message).setStatus("Danger")],
         ephemeral: true,
         components: []
     });
@@ -60,23 +57,27 @@
             const member = await interaction.guild?.members.fetch(memberId!);
             switch (action) {
                 case "kick": {
-                    const check = await kickCheck(interaction, false, member)
+                    const check = await kickCheck(interaction, false, member);
                     if (check !== true) return await errorMessage(interaction, check!);
                     return await kickCallback(interaction, member);
-                } case "ban": {
-                    const check = await banCheck(interaction, false, member)
+                }
+                case "ban": {
+                    const check = await banCheck(interaction, false, member);
                     if (check !== true) return await errorMessage(interaction, check!);
                     return await banCallback(interaction, member);
-                } case "mute": {
-                    const check = await muteCheck(interaction, false, member)
+                }
+                case "mute": {
+                    const check = await muteCheck(interaction, false, member);
                     if (check !== true) return await errorMessage(interaction, check!);
                     return await muteCallback(interaction, member);
-                } case "nickname": {
-                    const check = await nicknameCheck(interaction, false, member)
+                }
+                case "nickname": {
+                    const check = await nicknameCheck(interaction, false, member);
                     if (check !== true) return await errorMessage(interaction, check || "Something went wrong");
                     return await nicknameCallback(interaction, member);
-                } case "warn": {
-                    const check = await warnCheck(interaction, false, member)
+                }
+                case "warn": {
+                    const check = await warnCheck(interaction, false, member);
                     if (check !== true) return await errorMessage(interaction, check!);
                     return await warnCallback(interaction, member);
                 }
diff --git a/src/events/memberJoin.ts b/src/events/memberJoin.ts
index 191ba6b..66abe28 100644
--- a/src/events/memberJoin.ts
+++ b/src/events/memberJoin.ts
@@ -9,7 +9,7 @@
 export async function callback(client: NucleusClient, member: GuildMember) {
     welcome(member);
     statsChannelAdd(member.user, member.guild);
-    doMemberChecks(member, member.guild)
+    doMemberChecks(member, member.guild);
     const { log, isLogging, NucleusColors, entry, renderUser, renderDelta } = client.logger;
     if (!(await isLogging(member.guild.id, "guildMemberUpdate"))) return;
     await client.database.history.create("join", member.guild.id, member.user, null, null);
