diff --git a/src/events/guildMemberUpdate.ts b/src/events/guildMemberUpdate.ts
index a0acd34..41a22c1 100644
--- a/src/events/guildMemberUpdate.ts
+++ b/src/events/guildMemberUpdate.ts
@@ -111,7 +111,6 @@
                 timestamp: Date.now()
             },
             list: {
-                memberId: entry(after.id, `\`${after.id}\``),
                 name: entry(after.user.id, renderUser(after.user)),
                 before: entry(before.nickname, before.nickname ? before.nickname : "*None*"),
                 after: entry(after.nickname, after.nickname ? after.nickname : "*None*"),
diff --git a/src/events/guildUpdate.ts b/src/events/guildUpdate.ts
index dbd747f..c48c82f 100644
--- a/src/events/guildUpdate.ts
+++ b/src/events/guildUpdate.ts
@@ -5,7 +5,7 @@
 export const event = "guildUpdate";
 
 export async function callback(client: NucleusClient, before: Guild, after: Guild) {
-    await statsChannelUpdate(client, after.members.me!);
+    await statsChannelUpdate(after.members.me!.user, after);
     const { getAuditLog, isLogging, log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
     if (!(await isLogging(after.id, "guildUpdate"))) return;
     const auditLog = (await getAuditLog(after, AuditLogEvent.GuildUpdate)).filter(
diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts
index c91f8cd..4a8d941 100644
--- a/src/events/interactionCreate.ts
+++ b/src/events/interactionCreate.ts
@@ -4,13 +4,30 @@
 import close from "../actions/tickets/delete.js";
 import createTranscript from "../premium/createTranscript.js";
 
-import type { Interaction } from "discord.js";
+import type { ButtonInteraction, Interaction } from "discord.js";
 import type Discord from "discord.js";
 import type { NucleusClient } from "../utils/client.js";
 import EmojiEmbed from "../utils/generateEmojiEmbed.js";
 
+import { callback as banCallback, check as banCheck } from "../commands/mod/ban.js";
+import { callback as kickCallback, check as kickCheck } from "../commands/mod/kick.js";
+import { callback as muteCallback, check as muteCheck } from "../commands/mod/mute.js";
+import { callback as nicknameCallback, check as nicknameCheck } from "../commands/mod/nick.js";
+import { callback as warnCallback, check as warnCheck } from "../commands/mod/warn.js";
+
 export const event = "interactionCreate";
 
+async function errorMessage(interaction: ButtonInteraction, message: string) {
+    await interaction.reply({
+        embeds: [new EmojiEmbed()
+            .setDescription(message)
+            .setStatus("Danger")
+        ],
+        ephemeral: true,
+        components: []
+    });
+}
+
 async function interactionCreate(interaction: Interaction) {
     if (interaction.isButton()) {
         switch (interaction.customId) {
@@ -36,6 +53,35 @@
                 return await modifySuggestion(interaction, false);
             }
         }
+        // Mod actions
+        if (interaction.customId.startsWith("mod:")) {
+            const action = interaction.customId.split(":")[1];
+            const memberId = interaction.customId.split(":")[2];
+            const member = await interaction.guild?.members.fetch(memberId!);
+            switch (action) {
+                case "kick": {
+                    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)
+                    if (check !== true) return await errorMessage(interaction, check!);
+                    return await banCallback(interaction, 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)
+                    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)
+                    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 bdfd999..191ba6b 100644
--- a/src/events/memberJoin.ts
+++ b/src/events/memberJoin.ts
@@ -2,12 +2,14 @@
 import { callback as statsChannelAdd } from "../reflex/statsChannelUpdate.js";
 import { callback as welcome } from "../reflex/welcome.js";
 import type { NucleusClient } from "../utils/client.js";
+import { doMemberChecks } from "../reflex/scanners.js";
 
 export const event = "guildMemberAdd";
 
 export async function callback(client: NucleusClient, member: GuildMember) {
-    welcome(client, member);
-    statsChannelAdd(client, member);
+    welcome(member);
+    statsChannelAdd(member.user, 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);
diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts
index 4c85052..0281fa1 100644
--- a/src/events/messageCreate.ts
+++ b/src/events/messageCreate.ts
@@ -30,7 +30,7 @@
     if (message.author.bot) return;
     if (message.channel.isDMBased()) return;
     try {
-        await statsChannelUpdate(client, await message.guild.members.fetch(message.author.id));
+        await statsChannelUpdate((await message.guild.members.fetch(message.author.id)).user, message.guild);
     } catch (e) {
         console.log(e);
     }
