diff --git a/src/Unfinished/all.ts b/src/Unfinished/all.ts
index db43527..51be5cb 100644
--- a/src/Unfinished/all.ts
+++ b/src/Unfinished/all.ts
@@ -39,18 +39,18 @@
         },
         joined: {
             render: "joined",
-            before: (date) => ( new Filter((data) => `Joined server before <t:${Math.round(date.getTime() / 1000)}:D>`, {date: date, type: Date, render: "before"}, (member) => {
+            before: (date) => ( new Filter((_data) => `Joined server before <t:${Math.round(date.getTime() / 1000)}:D>`, {date: date, type: Date, render: "before"}, (member) => {
                 return member.joinedTimestamp < date.getTime();
             }))
         },
         nickname: {
             render: "Nickname",
-            set: () => ( new Filter((data) => "Member has a nickname set\"", {render: "set"}, (member) => { return member.nickname !== null;})),
-            includes: (name) => ( new Filter((data) => `Nickname includes "${name}"`, {nickname: name, type: String, render: "includes"}, (member) => {
+            set: () => ( new Filter((_data) => "Member has a nickname set\"", {render: "set"}, (member) => { return member.nickname !== null;})),
+            includes: (name) => ( new Filter((_data) => `Nickname includes "${name}"`, {nickname: name, type: String, render: "includes"}, (member) => {
                 return member.displayName.includes(name);})),
-            startsWith: (name) => ( new Filter((data) => `Nickname starts with "${name}"`, {nickname: name, type: String, render: "starts with"}, (member) => {
+            startsWith: (name) => ( new Filter((_data) => `Nickname starts with "${name}"`, {nickname: name, type: String, render: "starts with"}, (member) => {
                 return member.displayName.startsWith(name);})),
-            endsWith: (name) => ( new Filter((data) => `Nickname ends with "${name}"`, {nickname: name, type: String, render: "ends with"}, (member) => {
+            endsWith: (name) => ( new Filter((_data) => `Nickname ends with "${name}"`, {nickname: name, type: String, render: "ends with"}, (member) => {
                 return member.displayName.endsWith(name);}))
         }
     },
@@ -58,27 +58,27 @@
         render: "Account",
         created: {
             render: "created",
-            before: (date) => ( new Filter((data) => `Account created before <t:${Math.round(date.getTime() / 1000)}:D>`, {date: date, type: Date, render: "before"}, (member) => {
+            before: (date) => ( new Filter((_data) => `Account created before <t:${Math.round(date.getTime() / 1000)}:D>`, {date: date, type: Date, render: "before"}, (member) => {
                 return member.user.createdTimestamp < date.getTime();
             }))
         },
         is: {
             render: "is",
-            human: () => ( new Filter((data) => "Member is a human", {human: true, render: "human"}, (member) => { return !member.bot; }))
+            human: () => ( new Filter((_data) => "Member is a human", {human: true, render: "human"}, (member) => { return !member.bot; }))
         },
         username: {
             render: "Username",
-            includes: (name) => ( new Filter((data) => `Nickname includes "${name}"`, {nickname: name, type: String, render: "includes"}, (member) => {
+            includes: (name) => ( new Filter((_data) => `Nickname includes "${name}"`, {nickname: name, type: String, render: "includes"}, (member) => {
                 return member.user.name.includes(name);})),
-            startsWith: (name) => ( new Filter((data) => `Nickname starts with "${name}"`, {nickname: name, type: String, render: "starts with"}, (member) => {
+            startsWith: (name) => ( new Filter((_data) => `Nickname starts with "${name}"`, {nickname: name, type: String, render: "starts with"}, (member) => {
                 return member.user.name.startsWith(name);})),
-            endsWith: (name) => ( new Filter((data) => `Nickname ends with "${name}"`, {nickname: name, type: String, render: "ends with"}, (member) => {
+            endsWith: (name) => ( new Filter((_data) => `Nickname ends with "${name}"`, {nickname: name, type: String, render: "ends with"}, (member) => {
                 return member.user.name.endsWith(name);}))
         }
     }
 };
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
     await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true});
     const filters: Filter[] = [
         filterList.member.has.role("959901346000154674"),
@@ -135,9 +135,10 @@
         ]});
         break;
     }
+    return;
 };
 
-const check = async (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = async (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
     const member = (interaction.member as GuildMember);
     const me = (interaction.guild.me as GuildMember);
     if (!me.permissions.has("MANAGE_ROLES")) throw "I do not have the *Manage Roles* permission";
diff --git a/src/Unfinished/categorisationTest.ts b/src/Unfinished/categorisationTest.ts
index 4d0d50a..4ba582d 100644
--- a/src/Unfinished/categorisationTest.ts
+++ b/src/Unfinished/categorisationTest.ts
@@ -11,7 +11,7 @@
     .setName("categorise")
     .setDescription("Categorises your servers channels");
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
     const channels = interaction.guild.channels.cache.filter(c => c.type !== "GUILD_CATEGORY");
     const categorised = {};
     await interaction.reply({embeds: LoadingEmbed, ephemeral: true});
@@ -40,8 +40,8 @@
     let m;
     for (const c of channels) {
         // convert channel to a channel if its a string
-        let channel: any;
-        if (typeof c === "string") channel = interaction.guild.channels.cache.get(channel).id;
+        let channel: string | GuildChannel;
+        if (typeof c === "string") channel = interaction.guild.channels.cache.get(channel as string).id;
         else channel = (c[0] as unknown as GuildChannel).id;
         console.log(channel);
         if (!predicted[channel]) predicted[channel] = [];
@@ -89,7 +89,7 @@
     console.log(categorised);
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
     return true;
 };
 
diff --git a/src/actions/roleMenu.ts b/src/actions/roleMenu.ts
index 6fd73ac..9a8e80a 100644
--- a/src/actions/roleMenu.ts
+++ b/src/actions/roleMenu.ts
@@ -1,4 +1,4 @@
-import { Message, MessageButton } from "discord.js";
+import { MessageButton } from "discord.js";
 import EmojiEmbed from "../utils/generateEmojiEmbed.js";
 import { MessageActionRow, MessageSelectMenu } from "discord.js";
 import getEmojiByName from "../utils/getEmojiByName.js";
@@ -73,7 +73,7 @@
         });
     }
     let component;
-    try { component = await (m as Message).awaitMessageComponent({time: 300000});
+    try { component = await m.awaitMessageComponent({time: 300000});
     } catch (e) { return; }
     component.deferUpdate();
     let rolesToAdd = [];
@@ -113,7 +113,7 @@
         });
         let component;
         try {
-            component = await (m as Message).awaitMessageComponent({time: 300000});
+            component = await m.awaitMessageComponent({time: 300000});
         } catch (e) {
             return;
         }
diff --git a/src/actions/tickets/create.ts b/src/actions/tickets/create.ts
index 6c8d42c..f724728 100644
--- a/src/actions/tickets/create.ts
+++ b/src/actions/tickets/create.ts
@@ -74,7 +74,7 @@
         ], ephemeral: true, fetchReply: true, components: splitFormattedTicketTypes});
         let component;
         try {
-            component = await (m as Discord.Message).awaitMessageComponent({time: 300000});
+            component = await m.awaitMessageComponent({time: 300000});
         } catch (e) {
             return;
         }
diff --git a/src/actions/tickets/delete.ts b/src/actions/tickets/delete.ts
index 3419763..e5c017f 100644
--- a/src/actions/tickets/delete.ts
+++ b/src/actions/tickets/delete.ts
@@ -7,8 +7,9 @@
     const { log, NucleusColors, entry, renderUser, renderChannel, renderDelta } = client.logger;
 
     const config = await client.database.guilds.read(interaction.guild.id);
-    let thread = false; let threadChannel;
-    if (interaction.channel instanceof Discord.ThreadChannel) thread = true; threadChannel = interaction.channel as Discord.ThreadChannel;
+    let thread = false;
+    if (interaction.channel instanceof Discord.ThreadChannel) thread = true;
+    const threadChannel = interaction.channel as Discord.ThreadChannel;
     const channel = (interaction.channel as Discord.TextChannel);
     if (!channel.parent || config.tickets.category !== channel.parent.id || (thread ? (threadChannel.parent.parent.id !== config.tickets.category) : false)) {
         return interaction.reply({embeds: [new EmojiEmbed()
diff --git a/src/api/index.ts b/src/api/index.ts
index 1750509..b94bbe0 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -3,7 +3,6 @@
 import bodyParser from "body-parser";
 import EmojiEmbed from "../utils/generateEmojiEmbed.js";
 import structuredClone from "@ungap/structured-clone";
-import client from "../utils/client.js";
 
 
 const jsonParser = bodyParser.json();
@@ -89,7 +88,6 @@
     app.post("/rolemenu/:code", jsonParser, async function (req, res) {
         const code = req.params.code;
         const secret = req.body.secret;
-        const data = req.body.data;
         if (secret === client.config.verifySecret) {
             const guild = await client.guilds.fetch(client.roleMenu[code].guild);
             if (!guild) { return res.status(404); }
diff --git a/src/commands/mod/ban.ts b/src/commands/mod/ban.ts
index 57db408..a55dcfa 100644
--- a/src/commands/mod/ban.ts
+++ b/src/commands/mod/ban.ts
@@ -1,6 +1,5 @@
 import { CommandInteraction, GuildMember, MessageActionRow, MessageButton } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
 import confirmationMessage from "../../utils/confirmationMessage.js";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import keyValueList from "../../utils/generateKeyValueList.js";
@@ -14,7 +13,7 @@
         .addUserOption(option => option.setName("user").setDescription("The user to ban").setRequired(true))
         .addNumberOption(option => option.setName("delete").setDescription("The days of messages to delete | Default: 0").setMinValue(0).setMaxValue(7).setRequired(false));
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
     const { renderUser } = client.logger;
     // TODO:[Modals] Replace this with a modal
     let reason = null;
@@ -121,7 +120,7 @@
     }
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
     const member = (interaction.member as GuildMember);
     const me = (interaction.guild.me as GuildMember);
     const apply = (interaction.options.getMember("user") as GuildMember);
diff --git a/src/commands/mod/info.ts b/src/commands/mod/info.ts
index 482af5b..68b3ce7 100644
--- a/src/commands/mod/info.ts
+++ b/src/commands/mod/info.ts
@@ -1,7 +1,6 @@
 import { HistorySchema } from "../../utils/database";
 import Discord, { CommandInteraction, GuildMember, MessageActionRow, MessageButton, TextInputComponent } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import getEmojiByName from "../../utils/getEmojiByName.js";
 import client from "../../utils/client.js";
@@ -199,7 +198,7 @@
 }
 
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
     let m;
     const member = (interaction.options.getMember("user")) as Discord.GuildMember;
     await interaction.reply({embeds: [new EmojiEmbed()
@@ -273,7 +272,7 @@
     }
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
     const member = (interaction.member as GuildMember);
     if (! member.permissions.has("MODERATE_MEMBERS")) throw "You do not have the *Moderate Members* permission";
     return true;
diff --git a/src/commands/mod/kick.ts b/src/commands/mod/kick.ts
index b9b1b2a..23785c3 100644
--- a/src/commands/mod/kick.ts
+++ b/src/commands/mod/kick.ts
@@ -1,7 +1,6 @@
 import { CommandInteraction, GuildMember, MessageActionRow, MessageButton } from "discord.js";
 import humanizeDuration from "humanize-duration";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
 import confirmationMessage from "../../utils/confirmationMessage.js";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import keyValueList from "../../utils/generateKeyValueList.js";
@@ -13,7 +12,7 @@
         .setDescription("Kicks a user from the server")
         .addUserOption(option => option.setName("user").setDescription("The user to kick").setRequired(true));
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
     const { renderUser } = client.logger;
     // TODO:[Modals] Replace this with a modal
     let reason = null;
@@ -120,7 +119,7 @@
     }
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
     const member = (interaction.member as GuildMember);
     const me = (interaction.guild.me as GuildMember);
     const apply = (interaction.options.getMember("user") as GuildMember);
diff --git a/src/commands/mod/mute.ts b/src/commands/mod/mute.ts
index 183c487..1e9a812 100644
--- a/src/commands/mod/mute.ts
+++ b/src/commands/mod/mute.ts
@@ -1,7 +1,6 @@
 import { LoadingEmbed } from "./../../utils/defaultEmbeds.js";
-import Discord, { CommandInteraction, GuildMember, MessageActionRow, MessageButton } from "discord.js";
+import Discord, { CommandInteraction, GuildMember, Message, MessageActionRow, MessageButton } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import getEmojiByName from "../../utils/getEmojiByName.js";
 import confirmationMessage from "../../utils/confirmationMessage.js";
@@ -20,7 +19,7 @@
         .addIntegerOption(option => option.setName("minutes").setDescription("The number of minutes to mute the user for | Default: 0").setMinValue(0).setMaxValue(59).setRequired(false))
         .addIntegerOption(option => option.setName("seconds").setDescription("The number of seconds to mute the user for | Default: 0").setMinValue(0).setMaxValue(59).setRequired(false));
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
     const { log, NucleusColors, renderUser, entry, renderDelta } = client.logger;
     const user = interaction.options.getMember("user") as GuildMember;
     const time = {
@@ -85,10 +84,10 @@
                     .setStyle("DANGER")
                     .setEmoji(getEmojiByName("CONTROL.CROSS", "id"))
             ])
-        ], ephemeral: true, fetchReply: true});
+        ], ephemeral: true, fetchReply: true}) as Message;
         let component;
         try {
-            component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
+            component = await m.awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
         } catch { return; }
         component.deferUpdate();
         if (component.customId === "cancel") return interaction.editReply({embeds: [new EmojiEmbed()
@@ -244,7 +243,7 @@
     }
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
     const member = (interaction.member as GuildMember);
     const me = (interaction.guild.me as GuildMember);
     const apply = (interaction.options.getMember("user") as GuildMember);
diff --git a/src/commands/mod/nick.ts b/src/commands/mod/nick.ts
index 9cc8a7c..06fab47 100644
--- a/src/commands/mod/nick.ts
+++ b/src/commands/mod/nick.ts
@@ -1,10 +1,8 @@
-import { CommandInteraction, GuildMember, MessageActionRow, MessageButton } from "discord.js";
+import { CommandInteraction, GuildMember } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
 import confirmationMessage from "../../utils/confirmationMessage.js";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import keyValueList from "../../utils/generateKeyValueList.js";
-import { create, areTicketsEnabled } from "../../actions/createModActionTicket.js";
 import client from "../../utils/client.js";
 
 const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -14,7 +12,7 @@
         .addUserOption(option => option.setName("user").setDescription("The user to change").setRequired(true))
         .addStringOption(option => option.setName("name").setDescription("The name to set | Leave blank to clear").setRequired(false));
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
     const { renderUser } = client.logger;
     // TODO:[Modals] Replace this with a modal
     let notify = true;
@@ -113,7 +111,7 @@
     }
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
     const member = (interaction.member as GuildMember);
     const me = (interaction.guild.me as GuildMember);
     const apply = (interaction.options.getMember("user") as GuildMember);
diff --git a/src/commands/mod/purge.ts b/src/commands/mod/purge.ts
index 13e688b..c554ee7 100644
--- a/src/commands/mod/purge.ts
+++ b/src/commands/mod/purge.ts
@@ -1,6 +1,5 @@
 import Discord, { CommandInteraction, GuildChannel, GuildMember, TextChannel } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
 import confirmationMessage from "../../utils/confirmationMessage.js";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import keyValueList from "../../utils/generateKeyValueList.js";
@@ -20,7 +19,7 @@
         .addUserOption(option => option.setName("user").setDescription("The user to purge messages from").setRequired(false))
         .addStringOption(option => option.setName("reason").setDescription("The reason for the purge").setRequired(false));
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
     const user = interaction.options.getMember("user") as GuildMember ?? null;
     const channel = (interaction.channel as GuildChannel);
     if (!(["GUILD_TEXT", "GUILD_NEWS", "GUILD_NEWS_THREAD", "GUILD_PUBLIC_THREAD", "GUILD_PRIVATE_THREAD"].includes(channel.type.toString()))) {
@@ -97,10 +96,10 @@
                             .setEmoji(getEmojiByName("CONTROL.TICK", "id"))
                     ])
                 ]
-            });
+            }) as Discord.Message;
             let component;
             try {
-                component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
+                component = m.awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
             } catch (e) { break; }
             component.deferUpdate();
             if (component.customId === "done") break;
@@ -174,10 +173,10 @@
                 .setLabel("Download transcript")
                 .setStyle("SUCCESS")
                 .setEmoji(getEmojiByName("CONTROL.DOWNLOAD", "id"))
-        ])]});
+        ])]}) as Discord.Message;
         let component;
         try {
-            component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
+            component = await m.awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
         } catch { return; }
         if (component && component.customId === "download") {
             interaction.editReply({embeds: [new EmojiEmbed()
@@ -273,10 +272,10 @@
                     .setLabel("Download transcript")
                     .setStyle("SUCCESS")
                     .setEmoji(getEmojiByName("CONTROL.DOWNLOAD", "id"))
-            ])]});
+            ])]}) as Discord.Message;
             let component;
             try {
-                component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
+                component = await m.awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
             } catch { return; }
             if (component && component.customId === "download") {
                 interaction.editReply({embeds: [new EmojiEmbed()
@@ -304,7 +303,7 @@
     }
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
     const member = (interaction.member as GuildMember);
     const me = (interaction.guild.me as GuildMember);
     // Check if nucleus has the manage_messages permission
diff --git a/src/commands/mod/slowmode.ts b/src/commands/mod/slowmode.ts
index 951dc53..7e8b8a2 100644
--- a/src/commands/mod/slowmode.ts
+++ b/src/commands/mod/slowmode.ts
@@ -1,7 +1,6 @@
 import humanizeDuration from "humanize-duration";
 import { CommandInteraction, GuildMember, TextChannel } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
 import keyValueList from "../../utils/generateKeyValueList.js";
 import confirmationMessage from "../../utils/confirmationMessage.js";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
@@ -19,7 +18,7 @@
             ["1 hour", "3600"], ["2 hours", "7200"], ["6 hours", "21600"]
         ]));
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
     let time = parseInt(interaction.options.getString("time") ?? "0");
     if (time === 0 && (interaction.channel as TextChannel).rateLimitPerUser === 0) { time = 10; }
     const confirmation = await new confirmationMessage(interaction)
@@ -59,7 +58,7 @@
     }
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
     const member = (interaction.member as GuildMember);
     // Check if Nucleus can set the slowmode
     if (! interaction.guild.me.permissions.has("MANAGE_CHANNELS")) throw "I do not have the *Manage Channels* permission";
diff --git a/src/commands/mod/softban.ts b/src/commands/mod/softban.ts
index 88ba531..d0dc9bb 100644
--- a/src/commands/mod/softban.ts
+++ b/src/commands/mod/softban.ts
@@ -1,6 +1,5 @@
 import { CommandInteraction, GuildMember, MessageActionRow, MessageButton } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
 import confirmationMessage from "../../utils/confirmationMessage.js";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import keyValueList from "../../utils/generateKeyValueList.js";
@@ -14,7 +13,7 @@
         .addUserOption(option => option.setName("user").setDescription("The user to softban").setRequired(true))
         .addIntegerOption(option => option.setName("delete").setDescription("The days of messages to delete | Default: 0").setMinValue(0).setMaxValue(7).setRequired(false));
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
     const { renderUser } = client.logger;
     // TODO:[Modals] Replace this with a modal
     let reason = null;
@@ -98,7 +97,7 @@
     }
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
     const member = (interaction.member as GuildMember);
     const me = (interaction.guild.me as GuildMember);
     const apply = (interaction.options.getMember("user") as GuildMember);
diff --git a/src/commands/mod/unban.ts b/src/commands/mod/unban.ts
index faf1f08..88301eb 100644
--- a/src/commands/mod/unban.ts
+++ b/src/commands/mod/unban.ts
@@ -1,6 +1,5 @@
 import { CommandInteraction, GuildMember, User } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import keyValueList from "../../utils/generateKeyValueList.js";
 import confirmationMessage from "../../utils/confirmationMessage.js";
@@ -12,7 +11,7 @@
         .setDescription("Unbans a user")
         .addStringOption(option => option.setName("user").setDescription("The user to unban (Username or ID)").setRequired(true));
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
     const bans = await interaction.guild.bans.fetch();
     const user = interaction.options.getString("user");
     let resolved = bans.find(ban => ban.user.id === user);
@@ -88,7 +87,7 @@
     }
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
     const member = (interaction.member as GuildMember);
     const me = (interaction.guild.me as GuildMember);
     // Check if Nucleus can unban members
diff --git a/src/commands/mod/unmute.ts b/src/commands/mod/unmute.ts
index e00c16d..d4e0d75 100644
--- a/src/commands/mod/unmute.ts
+++ b/src/commands/mod/unmute.ts
@@ -1,6 +1,5 @@
 import { CommandInteraction, GuildMember } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
 import confirmationMessage from "../../utils/confirmationMessage.js";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import keyValueList from "../../utils/generateKeyValueList.js";
@@ -12,7 +11,7 @@
         .setDescription("Unmutes a user")
         .addUserOption(option => option.setName("user").setDescription("The user to unmute").setRequired(true));
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
     const { log, NucleusColors, renderUser, entry, renderDelta } = client.logger;
     // TODO:[Modals] Replace this with a modal
     let reason = null;
@@ -106,7 +105,7 @@
     }
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
     const member = (interaction.member as GuildMember);
     const me = (interaction.guild.me as GuildMember);
     const apply = (interaction.options.getMember("user") as GuildMember);
diff --git a/src/commands/mod/viewas.ts b/src/commands/mod/viewas.ts
index a5bf5ea..ca52787 100644
--- a/src/commands/mod/viewas.ts
+++ b/src/commands/mod/viewas.ts
@@ -1,7 +1,6 @@
 import Discord, { CategoryChannel, CommandInteraction, GuildMember, MessageActionRow, MessageButton, MessageSelectMenu } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
-import { WrappedCheck } from "jshaiku";
 import getEmojiByName from "../../utils/getEmojiByName.js";
 import pageIndicator from "../../utils/createPageIndicator.js";
 
@@ -11,7 +10,7 @@
         .setDescription("View the server as a specific member")
         .addUserOption(option => option.setName("member").setDescription("The member to view as").setRequired(true));
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
     let channels = [];
     let m;
     interaction.guild.channels.cache.forEach(channel => {
@@ -96,7 +95,7 @@
 };
 
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
     const member = (interaction.member as GuildMember);
     if (! member.permissions.has("MANAGE_ROLES")) throw "You do not have the *Manage Roles* permission";
     return true;
diff --git a/src/commands/mod/warn.ts b/src/commands/mod/warn.ts
index 0648f66..34ad3c3 100644
--- a/src/commands/mod/warn.ts
+++ b/src/commands/mod/warn.ts
@@ -1,6 +1,5 @@
 import Discord, { CommandInteraction, GuildMember, MessageActionRow, MessageButton } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
 import confirmationMessage from "../../utils/confirmationMessage.js";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import keyValueList from "../../utils/generateKeyValueList.js";
@@ -13,7 +12,7 @@
         .setDescription("Warns a user")
         .addUserOption(option => option.setName("user").setDescription("The user to warn").setRequired(true));
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
     const { log, NucleusColors, renderUser, entry } = client.logger;
     // TODO:[Modals] Replace this with a modal
     let reason = null;
@@ -131,10 +130,10 @@
                             .setStyle(canSeeChannel ? "SECONDARY" : "PRIMARY")
                     ])
                 ]
-            });
+            }) as Discord.Message;
             let component;
             try {
-                component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
+                component = await m.awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
             } catch (e) {
                 return await interaction.editReply({embeds: [new EmojiEmbed()
                     .setEmoji("PUNISH.WARN.GREEN")
@@ -196,13 +195,12 @@
     }
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
     const member = (interaction.member as GuildMember);
     const me = (interaction.guild.me as GuildMember);
     const apply = (interaction.options.getMember("user") as GuildMember);
     if (member === null || me === null || apply === null) throw "That member is not in the server";
     const memberPos = member.roles ? member.roles.highest.position : 0;
-    const mePos = me.roles ? me.roles.highest.position : 0;
     const applyPos = apply.roles ? apply.roles.highest.position : 0;
     // Do not allow warning bots
     if (member.user.bot) throw "I cannot warn bots";
diff --git a/src/commands/nucleus/guide.ts b/src/commands/nucleus/guide.ts
index 507730b..3141f9f 100644
--- a/src/commands/nucleus/guide.ts
+++ b/src/commands/nucleus/guide.ts
@@ -1,8 +1,4 @@
-import Discord, { CommandInteraction, MessageActionRow, MessageButton } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
-import getEmojiByName from "../../utils/getEmojiByName.js";
-import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import guide from "../../reflex/guide.js";
 
 const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -15,7 +11,7 @@
     guide(interaction.guild, interaction);
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = () => {
     return true;
 };
 
diff --git a/src/commands/nucleus/invite.ts b/src/commands/nucleus/invite.ts
index 5a1ea59..ebc3c34 100644
--- a/src/commands/nucleus/invite.ts
+++ b/src/commands/nucleus/invite.ts
@@ -1,6 +1,5 @@
 import { CommandInteraction, MessageActionRow, MessageButton } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import client from "../../utils/client.js";
 
@@ -9,7 +8,7 @@
         .setName("invite")
         .setDescription("Invites Nucleus to your server");
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
     interaction.reply({embeds: [new EmojiEmbed()
         .setTitle("Invite")
         .setDescription("You can invite Nucleus to your server by clicking the button below")
@@ -22,7 +21,7 @@
     ])], ephemeral: true});
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = () => {
     return true;
 };
 
diff --git a/src/commands/nucleus/ping.ts b/src/commands/nucleus/ping.ts
index c153e19..91e8363 100644
--- a/src/commands/nucleus/ping.ts
+++ b/src/commands/nucleus/ping.ts
@@ -2,7 +2,6 @@
 import { CommandInteraction } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
-import { WrappedCheck } from "jshaiku";
 import client from "../../utils/client.js";
 
 const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -10,7 +9,7 @@
         .setName("ping")
         .setDescription("Gets the bot's ping time");
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
     // WEBSOCKET | Nucleus -> Discord
     // EDITING   | Nucleus -> discord -> nucleus | edit time / 2
     const initial = new Date().getTime();
@@ -28,7 +27,7 @@
     ]});
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = () => {
     return true;
 };
 
diff --git a/src/commands/nucleus/premium.ts b/src/commands/nucleus/premium.ts
index c8c0f76..9ad2c16 100644
--- a/src/commands/nucleus/premium.ts
+++ b/src/commands/nucleus/premium.ts
@@ -1,6 +1,5 @@
-import { CommandInteraction, MessageActionRow, MessageButton } from "discord.js";
+import { CommandInteraction } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 
 const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -8,7 +7,7 @@
         .setName("premium")
         .setDescription("Information about Nucleus Premium");
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
     interaction.reply({embeds: [new EmojiEmbed()
         .setTitle("Premium")
         .setDescription(
@@ -22,7 +21,7 @@
     ], ephemeral: true});
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = () => {
     return true;
 };
 
diff --git a/src/commands/nucleus/stats.ts b/src/commands/nucleus/stats.ts
index 98b87be..2558997 100644
--- a/src/commands/nucleus/stats.ts
+++ b/src/commands/nucleus/stats.ts
@@ -1,6 +1,5 @@
 import { CommandInteraction } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import client from "../../utils/client.js";
 
@@ -9,7 +8,7 @@
         .setName("stats")
         .setDescription("Gets the bot's stats");
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
     interaction.reply({
         embeds: [new EmojiEmbed()
             .setTitle("Stats")
@@ -24,7 +23,7 @@
     });
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = () => {
     return true;
 };
 
diff --git a/src/commands/nucleus/suggest.ts b/src/commands/nucleus/suggest.ts
index 238e7d5..a6657d8 100644
--- a/src/commands/nucleus/suggest.ts
+++ b/src/commands/nucleus/suggest.ts
@@ -11,7 +11,7 @@
         .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 callback = async (interaction: CommandInteraction): Promise<void> => {
     const { renderUser } = client.logger;
     const suggestion = interaction.options.getString("suggestion");
     const confirmation = await new confirmationMessage(interaction)
@@ -49,7 +49,7 @@
     }
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
     return true;
 };
 
diff --git a/src/commands/privacy.ts b/src/commands/privacy.ts
index ca56fcd..8fb6b40 100644
--- a/src/commands/privacy.ts
+++ b/src/commands/privacy.ts
@@ -2,7 +2,6 @@
 import Discord, { CommandInteraction, MessageActionRow, MessageButton } from "discord.js";
 import { SelectMenuOption, SlashCommandBuilder } from "@discordjs/builders";
 import { WrappedCheck } from "jshaiku";
-import { testLink, testMalware, testNSFW } from "../reflex/scanners.js";
 import EmojiEmbed from "../utils/generateEmojiEmbed.js";
 import getEmojiByName from "../utils/getEmojiByName.js";
 import createPageIndicator from "../utils/createPageIndicator.js";
@@ -26,7 +25,7 @@
     setComponents(components: MessageActionRow[]) { this.components = components; return this; }
 }
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
     const pages = [
         new Embed()
             .setEmbed(new EmojiEmbed()
@@ -73,8 +72,7 @@
             new MessageButton().setLabel("Clear all data").setCustomId("clear-all-data").setStyle("DANGER")
         ])])
     ] : []);
-    let m;
-    m = await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true});
+    const m = await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true});
     let page = 0;
 
     let selectPaneOpen = false;
@@ -166,7 +164,7 @@
     });
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
     return true;
 };
 
diff --git a/src/commands/role/user.ts b/src/commands/role/user.ts
index d2b05e9..b54ee1e 100644
--- a/src/commands/role/user.ts
+++ b/src/commands/role/user.ts
@@ -18,7 +18,7 @@
         ]));
 
 
-const callback = async (interaction: CommandInteraction): Promise<any>  => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown>  => {
     const { renderUser, renderRole } = client.logger;
     const action = interaction.options.getString("action");
     // TODO:[Modals] Replace this with a modal
@@ -65,7 +65,7 @@
     }
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
     const member = (interaction.member as GuildMember);
     const me = (interaction.guild.me as GuildMember);
     const apply = (interaction.options.getMember("user") as GuildMember);
diff --git a/src/commands/rolemenu.ts b/src/commands/rolemenu.ts
index 1a5f297..dd3cb34 100644
--- a/src/commands/rolemenu.ts
+++ b/src/commands/rolemenu.ts
@@ -7,11 +7,11 @@
     .setName("rolemenu")
     .setDescription("Lets you choose from sets of roles to apply to yourself");
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
     await roleMenu(interaction);
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
     return true;
 };
 
diff --git a/src/commands/server/about.ts b/src/commands/server/about.ts
index b70d0a6..c0a2ede 100644
--- a/src/commands/server/about.ts
+++ b/src/commands/server/about.ts
@@ -1,4 +1,4 @@
-import Discord, { CommandInteraction, Guild, MessageActionRow, MessageButton } from "discord.js";
+import { CommandInteraction, Guild } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
 import { WrappedCheck } from "jshaiku";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
@@ -10,7 +10,7 @@
     .setName("about")
     .setDescription("Shows info about the server");
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
     const guild = interaction.guild as Guild;
     const { renderUser, renderDelta } = client.logger;
     interaction.reply({embeds: [new EmojiEmbed()
@@ -41,7 +41,7 @@
     ], ephemeral: true});
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
     return true;
 };
 
diff --git a/src/commands/settings/commands.ts b/src/commands/settings/commands.ts
index 7b6b309..845e001 100644
--- a/src/commands/settings/commands.ts
+++ b/src/commands/settings/commands.ts
@@ -15,7 +15,7 @@
         .setDescription("Links and text shown to a user after a moderator action is performed")
         .addRoleOption(o => o.setName("role").setDescription("The role given when a member is muted"));
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
     await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true});
     let m;
     let clicked = "";
@@ -117,7 +117,7 @@
             });
             let out;
             try {
-                out = await modalInteractionCollector(m, (m) => m.channel.id === interaction.channel.id, (m) => true);
+                out = await modalInteractionCollector(m, (m) => m.channel.id === interaction.channel.id, (_) => true);
             } catch (e) { continue; }
             if (out.fields) {
                 const buttonText = out.fields.getTextInputValue("name");
@@ -133,7 +133,7 @@
 };
 
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
     const member = (interaction.member as Discord.GuildMember);
     if (!member.permissions.has("MANAGE_GUILD")) throw "You must have the *Manage Server* permission to use this command";
     return true;
diff --git a/src/commands/settings/filters.ts b/src/commands/settings/filters.ts
index d35d210..7ee5b8d 100644
--- a/src/commands/settings/filters.ts
+++ b/src/commands/settings/filters.ts
@@ -1,24 +1,16 @@
-import { LoadingEmbed } from "./../../utils/defaultEmbeds.js";
-import Discord, { CommandInteraction, MessageActionRow, MessageButton, MessageSelectMenu } from "discord.js";
+import Discord, { CommandInteraction } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
-import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
-import client from "../../utils/client.js";
-import confirmationMessage from "../../utils/confirmationMessage.js";
-import generateKeyValueList from "../../utils/generateKeyValueList.js";
-import { ChannelType } from "discord-api-types";
-import getEmojiByName from "../../utils/getEmojiByName.js";
 
 const command = (builder: SlashCommandSubcommandBuilder) =>
     builder
         .setName("filter")
         .setDescription("Setting for message filters");
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
-
+const callback = async (_interaction: CommandInteraction): Promise<void> => {
+    console.log("Filters");
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
     const member = (interaction.member as Discord.GuildMember);
     if (!member.permissions.has("MANAGE_MESSAGES")) throw "You must have the *Manage Messages* permission to use this command";
     return true;
diff --git a/src/commands/settings/logs/attachment.ts b/src/commands/settings/logs/attachment.ts
index edd1c61..cb96567 100644
--- a/src/commands/settings/logs/attachment.ts
+++ b/src/commands/settings/logs/attachment.ts
@@ -16,9 +16,8 @@
             ChannelType.GuildNews, ChannelType.GuildText
         ]).setRequired(false));
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
-    let m;
-    m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true});
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
+    const m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true}) as Discord.Message;
     if (interaction.options.getChannel("channel")) {
         let channel;
         try {
@@ -141,7 +140,7 @@
     ])]});
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
     const member = (interaction.member as Discord.GuildMember);
     if (!member.permissions.has("MANAGE_GUILD")) throw "You must have the *Manage Server* permission to use this command";
     return true;
diff --git a/src/commands/settings/logs/channel.ts b/src/commands/settings/logs/channel.ts
index da0d156..4d4a392 100644
--- a/src/commands/settings/logs/channel.ts
+++ b/src/commands/settings/logs/channel.ts
@@ -16,9 +16,8 @@
             ChannelType.GuildNews, ChannelType.GuildText
         ]));
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
-    let m;
-    m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true});
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
+    const m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true}) as Discord.Message;
     if (interaction.options.getChannel("channel")) {
         let channel;
         try {
@@ -136,7 +135,7 @@
     ])]});
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
     const member = (interaction.member as Discord.GuildMember);
     if (!member.permissions.has("MANAGE_GUILD")) throw "You must have the *Manage Server* permission to use this command";
     return true;
diff --git a/src/commands/settings/logs/events.ts b/src/commands/settings/logs/events.ts
index 88386c4..110c70e 100644
--- a/src/commands/settings/logs/events.ts
+++ b/src/commands/settings/logs/events.ts
@@ -35,7 +35,7 @@
         .setName("events")
         .setDescription("Sets what events should be logged");
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
     await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true});
     let m;
     while (true) {
@@ -96,9 +96,10 @@
         .setStatus("Success")
         .setEmoji("CHANNEL.TEXT.CREATE")
     ]});
+    return;
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
     const member = (interaction.member as Discord.GuildMember);
     if (!member.permissions.has("MANAGE_GUILD")) throw "You must have the *Manage Server* permission to use this command";
     return true;
diff --git a/src/commands/settings/stats.ts b/src/commands/settings/stats.ts
index 4d61496..5a1affd 100644
--- a/src/commands/settings/stats.ts
+++ b/src/commands/settings/stats.ts
@@ -1,5 +1,5 @@
 import { LoadingEmbed } from "./../../utils/defaultEmbeds.js";
-import Discord, { CommandInteraction, MessageActionRow, MessageSelectMenu } from "discord.js";
+import Discord, { CommandInteraction, Message, MessageActionRow, MessageSelectMenu } from "discord.js";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import confirmationMessage from "../../utils/confirmationMessage.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
@@ -16,10 +16,9 @@
         .addChannelOption(option => option.setName("channel").setDescription("The channel to modify"))
         .addStringOption(option => option.setName("name").setDescription("The new channel name | Enter any text or use the extra variables like {memberCount}").setAutocomplete(true));
 
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
     singleNotify("statsChannelDeleted", interaction.guild.id, true);
-    let m;
-    m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true});
+    const m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true}) as Message;
     let config = await client.database.guilds.read(interaction.guild.id);
     if (interaction.options.getString("name")) {
         let channel;
@@ -140,10 +139,10 @@
             await client.database.guilds.write(interaction.guild.id, null, toRemove.map(k => `stats.${k}`));
         }
     }
-    await interaction.editReply({embeds: [m.embeds[0].setFooter({text: "Message closed"})], components: []});
+    await interaction.editReply({embeds: [(m.embeds[0] as Discord.MessageEmbed).setFooter({text: "Message closed"})], components: []});
 };
 
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
     const member = (interaction.member as Discord.GuildMember);
     if (!member.permissions.has("MANAGE_CHANNELS")) throw "You must have the *Manage Channels* permission to use this command";
     return true;
diff --git a/src/commands/settings/tickets.ts b/src/commands/settings/tickets.ts
index 31df394..f9df71c 100644
--- a/src/commands/settings/tickets.ts
+++ b/src/commands/settings/tickets.ts
@@ -2,7 +2,7 @@
 import getEmojiByName from "../../utils/getEmojiByName.js";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import confirmationMessage from "../../utils/confirmationMessage.js";
-import Discord, { CommandInteraction, GuildChannel, Interaction, Message, MessageActionRow, MessageActionRowComponent, MessageButton, MessageComponentInteraction, MessageSelectMenu, Role, SelectMenuInteraction, TextInputComponent } from "discord.js";
+import Discord, { CommandInteraction, GuildChannel, Message, MessageActionRow, MessageActionRowComponent, MessageButton, MessageComponentInteraction, MessageSelectMenu, Role, SelectMenuInteraction, TextInputComponent } from "discord.js";
 import { SelectMenuOption, SlashCommandSubcommandBuilder } from "@discordjs/builders";
 import { ChannelType } from "discord-api-types";
 import client from "../../utils/client.js";
@@ -21,14 +21,13 @@
     .addRoleOption(option => option.setName("supportrole").setDescription("This role will have view access to all tickets and will be pinged when a ticket is created").setRequired(false));
 
 const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
-    let m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true});
+    let m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true}) as Message;
     const options = {
         enabled: interaction.options.getString("enabled") as string | boolean,
         category: interaction.options.getChannel("category"),
         maxtickets: interaction.options.getNumber("maxticketsperuser"),
         supportping: interaction.options.getRole("supportrole")
     };
-    console.log(m);
     if (options.enabled !== null || options.category || options.maxtickets || options.supportping) {
         options.enabled = options.enabled === "yes" ? true : false;
         if (options.category) {
@@ -198,10 +197,10 @@
                     .setStyle("PRIMARY")
                     .setCustomId("send")
             ])]
-        });
+        }) as Message;
         let i: MessageComponentInteraction;
         try {
-            i = await (m as Message).awaitMessageComponent({ time: 300000 });
+            i = await m.awaitMessageComponent({ time: 300000 });
         } catch (e) { break; }
         i.deferUpdate();
         if ((i.component as MessageActionRowComponent).customId === "clearCategory") {
@@ -261,7 +260,7 @@
                 ]});
                 let i: MessageComponentInteraction;
                 try {
-                    i = await (m as Message).awaitMessageComponent({time: 300000});
+                    i = await m.awaitMessageComponent({time: 300000});
                 } catch(e) { break; }
                 if ((i.component as MessageActionRowComponent).customId === "template") {
                     i.deferUpdate();
@@ -350,7 +349,7 @@
     await interaction.editReply({ embeds: [embed.setFooter({ text: "Message closed" })], components: [] });
 };
 
-async function manageTypes(interaction: Interaction, data: GuildConfig["tickets"], m: Message) {
+async function manageTypes(interaction: CommandInteraction, data: GuildConfig["tickets"], m: Message) {
     while (true) {
         if (data.useCustom) {
             const customTypes = data.customTypes;
@@ -374,7 +373,10 @@
                         .setPlaceholder("Select types to remove")
                         .setMaxValues(customTypes.length)
                         .setMinValues(1)
-                        .addOptions(customTypes.map((t) => new SelectMenuOption().setLabel(t).setValue(t)))
+                        .addOptions(customTypes.map((t) => ({
+                            label: t,
+                            value: t
+                        })))
                     ])
                 ] : []).concat([
                     new MessageActionRow().addComponents([
diff --git a/src/commands/settings/verify.ts b/src/commands/settings/verify.ts
index d846511..4efd68c 100644
--- a/src/commands/settings/verify.ts
+++ b/src/commands/settings/verify.ts
@@ -1,9 +1,9 @@
 import { LoadingEmbed } from "./../../utils/defaultEmbeds.js";
-import Discord, { CommandInteraction, Message, MessageActionRow, MessageActionRowComponent, MessageButton, MessageComponentInteraction, MessageSelectMenu, Role, SelectMenuInteraction, TextInputComponent } from "discord.js";
+import Discord, { CommandInteraction, Message, MessageActionRow, MessageActionRowComponent, MessageButton, MessageComponentInteraction, MessageEmbed, MessageSelectMenu, Role, SelectMenuInteraction, TextInputComponent } from "discord.js";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import confirmationMessage from "../../utils/confirmationMessage.js";
 import getEmojiByName from "../../utils/getEmojiByName.js";
-import { Embed, SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
 import client from "../../utils/client.js";
 import { modalInteractionCollector } from "../../utils/dualCollector.js";
 
@@ -14,7 +14,7 @@
         .addRoleOption(option => option.setName("role").setDescription("The role to give after verifying").setRequired(false));
 
 const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
-    const m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true});
+    const m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true}) as Message;
     if (interaction.options.getRole("role")) {
         let role: Role;
         try {
@@ -109,7 +109,7 @@
         ])]});
         let i: MessageComponentInteraction;
         try {
-            i = await (m as Message).awaitMessageComponent({time: 300000});
+            i = await m.awaitMessageComponent({time: 300000});
         } catch(e) { break; }
         i.deferUpdate();
         if ((i.component as MessageActionRowComponent).customId === "clear") {
@@ -157,7 +157,7 @@
                 ]});
                 let i: MessageComponentInteraction;
                 try {
-                    i = await (m as Message).awaitMessageComponent({time: 300000});
+                    i = await m.awaitMessageComponent({time: 300000});
                 } catch(e) { break; }
                 if ((i.component as MessageActionRowComponent).customId === "template") {
                     i.deferUpdate();
@@ -239,7 +239,7 @@
             break;
         }
     }
-    await interaction.editReply({embeds: [(m.embeds[0] as Embed).setFooter({text: "Message closed"})], components: []});
+    await interaction.editReply({embeds: [(m.embeds[0] as MessageEmbed).setFooter({text: "Message closed"})], components: []});
 };
 
 const check = (interaction: CommandInteraction) => {
diff --git a/src/commands/tags/edit.ts b/src/commands/tags/edit.ts
index d7cfd04..b9cdddf 100644
--- a/src/commands/tags/edit.ts
+++ b/src/commands/tags/edit.ts
@@ -13,7 +13,7 @@
         .addStringOption(o => o.setName("value").setRequired(false).setDescription("The new value of the tag / Rename"))
         .addStringOption(o => o.setName("newname").setRequired(false).setDescription("The new name of the tag / Edit"));
 
-const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
     const name = interaction.options.getString("name");
     const value = interaction.options.getString("value") || "";
     const newname = interaction.options.getString("newname") || "";
diff --git a/src/commands/tags/list.ts b/src/commands/tags/list.ts
index accdd94..1a6c22c 100644
--- a/src/commands/tags/list.ts
+++ b/src/commands/tags/list.ts
@@ -52,7 +52,7 @@
                 .setStatus("Success")
             ).setTitle(`Page ${pages.length + 1}`).setPageId(pages.length));
     }
-    const m = await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true});
+    const m = await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true}) as Message;
     let page = 0;
     let selectPaneOpen = false;
     while (true) {
@@ -88,7 +88,7 @@
         });
         let i: MessageComponentInteraction;
         try {
-            i = await (m as Message).awaitMessageComponent({time: 300000 });
+            i = await m.awaitMessageComponent({time: 300000 });
         } catch (e) { break; }
         i.deferUpdate();
         if ((i.component as MessageActionRowComponent).customId === "left") {
diff --git a/src/commands/user/about.ts b/src/commands/user/about.ts
index 4835cd1..ede84b3 100644
--- a/src/commands/user/about.ts
+++ b/src/commands/user/about.ts
@@ -157,7 +157,7 @@
                 .setThumbnail(member.user.displayAvatarURL({dynamic: true}))
             ).setTitle("Key Permissions").setDescription("Key permissions the user has").setPageId(2)
     ];
-    const m = await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true});
+    const m = await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true}) as Message;
     let page = 0;
     let breakReason = "";
     while (true) {
@@ -208,7 +208,7 @@
         });
         let i: MessageComponentInteraction;
         try {
-            i = await (m as Message).awaitMessageComponent({time: 300000});
+            i = await m.awaitMessageComponent({time: 300000});
         } catch { breakReason = "Message timed out"; break; }
         i.deferUpdate();
         if ((i.component as MessageActionRowComponent).customId === "left") {
diff --git a/src/commands/user/track.ts b/src/commands/user/track.ts
index 48733fc..4720032 100644
--- a/src/commands/user/track.ts
+++ b/src/commands/user/track.ts
@@ -123,10 +123,11 @@
                                 currentRoleIndex === data.track.length - 1 || currentRoleIndex <= -1
                         ) || !allowed[currentRoleIndex])
                 ])
-            ])});
+            ])
+        }) as Message;
         let component;
         try {
-            component = await (m as Message).awaitMessageComponent({time: 300000});
+            component = await m.awaitMessageComponent({time: 300000});
         } catch (e) {
             return;
         }
diff --git a/src/utils/confirmationMessage.ts b/src/utils/confirmationMessage.ts
index a615fae..fd58d12 100644
--- a/src/utils/confirmationMessage.ts
+++ b/src/utils/confirmationMessage.ts
@@ -1,4 +1,4 @@
-import Discord, { CommandInteraction, MessageActionRow, Message, MessageButton, TextInputComponent } from "discord.js";
+import Discord, { CommandInteraction, MessageActionRow, MessageButton, TextInputComponent } from "discord.js";
 import { modalInteractionCollector } from "./dualCollector.js";
 import EmojiEmbed from "./generateEmojiEmbed.js";
 import getEmojiByName from "./getEmojiByName.js";
@@ -106,7 +106,7 @@
             } catch { return { cancelled: true }; }
             let component;
             try {
-                component = await (m as Message).awaitMessageComponent({filter: (m) => m.user.id === this.interaction.user.id, time: 300000});
+                component = await m.awaitMessageComponent({filter: (m) => m.user.id === this.interaction.user.id, time: 300000});
             } catch (e) {
                 return { success: false, components: this.customButtons };
             }
diff --git a/src/utils/dualCollector.ts b/src/utils/dualCollector.ts
index c785d0a..11df0ce 100644
--- a/src/utils/dualCollector.ts
+++ b/src/utils/dualCollector.ts
@@ -1,4 +1,4 @@
-import Discord from "discord.js";
+import Discord, { Interaction } from "discord.js";
 import client from "./client.js";
 
 export default async function (m, interactionFilter, messageFilter) {
@@ -24,14 +24,14 @@
     let out;
     try {
         out = await new Promise((resolve, _reject) => {
-            const int = m.createMessageComponentCollector({filter: (m) => interactionFilter(m), time: 300000})
-                .on("collect", (m) => { resolve(m); });
+            const int = m.createMessageComponentCollector({filter: (m: Interaction) => interactionFilter(m), time: 300000})
+                .on("collect", (m: Interaction) => { resolve(m); });
             const mod = new Discord.InteractionCollector(
                 client, {
-                    filter: (m) => modalFilter(m),
+                    filter: (m: Interaction) => modalFilter(m),
                     time: 300000
                 })
-                .on("collect", async (m) => {
+                .on("collect", async (m: Interaction) => {
                     int.stop();
                     (m as Discord.ModalSubmitInteraction).deferUpdate();
                     resolve((m as Discord.ModalSubmitInteraction)); });
diff --git a/src/utils/eventScheduler.ts b/src/utils/eventScheduler.ts
index cde178f..df46ca8 100644
--- a/src/utils/eventScheduler.ts
+++ b/src/utils/eventScheduler.ts
@@ -1,4 +1,4 @@
-import { Agenda } from "agenda/es.js";
+import { Agenda } from "@hokify/agenda";
 import client from "./client.js";
 import * as fs from "fs";
 import * as path from "path";
@@ -10,18 +10,18 @@
     constructor() {
         this.agenda = new Agenda({db: {address: config.mongoUrl + "Nucleus", collection: "eventScheduler"}});
 
-        this.agenda.define("unmuteRole", async (job: Agenda.job) => {
+        this.agenda.define("unmuteRole", async (job) => {
             const guild = await client.guilds.fetch(job.attrs.data.guild);
             const user = await guild.members.fetch(job.attrs.data.user);
             const role = await guild.roles.fetch(job.attrs.data.role);
             await user.roles.remove(role);
             await job.remove();
         });
-        this.agenda.define("deleteFile", async (job: Agenda.job) => {
+        this.agenda.define("deleteFile", async (job) => {
             fs.rm(path.resolve("dist/utils/temp", job.attrs.data.fileName), client._error);
             await job.remove();
         });
-        this.agenda.define("naturalUnmute", async (job: Agenda.job) => {
+        this.agenda.define("naturalUnmute", async (job) => {
             const { log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
             const guild = await client.guilds.fetch(job.attrs.data.guild);
             const user = await guild.members.fetch(job.attrs.data.user);
diff --git a/src/utils/generateEmojiEmbed.ts b/src/utils/generateEmojiEmbed.ts
index 7587db7..65e11fa 100644
--- a/src/utils/generateEmojiEmbed.ts
+++ b/src/utils/generateEmojiEmbed.ts
@@ -8,23 +8,24 @@
 };
 
 class EmojiEmbed extends MessageEmbed {
-    _title: string;
-    _emoji: string;
+    _title = "";
+    _emoji: string | null = null;
 
     // eslint-disable-next-line @typescript-eslint/ban-ts-comment
     // @ts-ignore
     // This *is* meant to be an accessor rather than a property
-    get title() {
+    override get title() {
+        if (!this._emoji) return this._title;
         return `${getEmojiByName(this._emoji)} ${this._title}`;
     }
 
-    set title(title: string) {
+    override set title(title: string) {
         this._title = title;
     }
 
-    setTitle(title: string) { this._title = title; return this; }
+    override setTitle(title: string) { this._title = title; return this; }
     setEmoji(emoji: string) { this._emoji = emoji; return this; }
-    setStatus(color: string) { this.setColor(colors[color]); return this; }
+    setStatus(color: "Danger" | "Warning" | "Success") { this.setColor(colors[color]); return this; }
 }
 
 export default EmojiEmbed;
\ No newline at end of file
diff --git a/src/utils/generateKeyValueList.ts b/src/utils/generateKeyValueList.ts
index ecb9780..a093ab7 100644
--- a/src/utils/generateKeyValueList.ts
+++ b/src/utils/generateKeyValueList.ts
@@ -7,7 +7,7 @@
 export function capitalize(s: string) {
     s = s.replace(/([A-Z])/g, " $1");
     s = s.split(" ").map(word => {
-        return forceCaps.includes(word.toUpperCase()) ? word.toUpperCase() : word[0]
+        return forceCaps.includes(word.toUpperCase()) ? word.toUpperCase() : (word[0] ?? "")
             .toUpperCase() + word.slice(1)
             .toLowerCase()
             .replace("discord", "Discord");
@@ -16,10 +16,11 @@
 }
 
 export function toCapitals(s: string) {
+    if (s[0] === undefined) return "";
     return s[0].toUpperCase() + s.slice(1).toLowerCase();
 }
 
-function keyValueList(data) {
+function keyValueList(data: Record<string, string>) {
     let out = "";
     Object.entries(data).map(([key, value]) => {
         out += `**${capitalize(key)}:** ${value}\n`;
diff --git a/src/utils/getEmojiByName.ts b/src/utils/getEmojiByName.ts
index 63b2042..c0a43cb 100644
--- a/src/utils/getEmojiByName.ts
+++ b/src/utils/getEmojiByName.ts
@@ -1,10 +1,21 @@
 import emojis from "../config/emojis.json" assert {type: "json"};
 
+interface EmojisIndex {
+    [key: string]: string | EmojisIndex | EmojisIndex[];
+}
+
 function getEmojiByName(name: string, format?: string): string {
     const split = name.split(".");
-    let id = emojis;
+    let id: string | EmojisIndex | EmojisIndex[] | undefined = emojis;
     split.forEach(part => {
-        id = id[part];
+        if (typeof id === "string" || id === undefined) {
+            throw new Error(`Emoji ${name} not found`);
+        }
+        if (Array.isArray(id)) {
+            id = id[parseInt(part)];
+        } else {
+            id = id[part];
+        }
     });
     if ( format === "id" ) {
         if (id === undefined) return "0";
diff --git a/src/utils/log.ts b/src/utils/log.ts
index 34b24c6..f9f751e 100644
--- a/src/utils/log.ts
+++ b/src/utils/log.ts
@@ -21,11 +21,11 @@
         t = Math.floor(t /= 1000);
         return `<t:${t}:R> (<t:${t}:D> at <t:${t}:T>)`;
     }
-    renderNumberDelta(num1, num2) {
+    renderNumberDelta(num1: number, num2: number) {
         const delta = num2 - num1;
         return `${num1} -> ${num2} (${delta > 0 ? "+" : ""}${delta})`;
     }
-    entry(value, displayValue) {
+    entry(value: string, displayValue: string) {
         return { value: value, displayValue: displayValue };
     }
     renderChannel(channel: Discord.GuildChannel | Discord.ThreadChannel) {
@@ -45,7 +45,7 @@
 
     };
 
-    async getAuditLog(guild: Discord.Guild, event): Promise<Discord.GuildAuditLogsEntry[]>{
+    async getAuditLog(guild: Discord.Guild, event: Discord.GuildAuditLogsResolvable): Promise<Discord.GuildAuditLogsEntry[]>{
         await wait(250);
         const auditLog = await guild.fetchAuditLogs({type: event});
         return auditLog as unknown as Discord.GuildAuditLogsEntry[];
@@ -60,9 +60,9 @@
         }
         if (config.logging.logs.channel) {
             const channel = await client.channels.fetch(config.logging.logs.channel) as Discord.TextChannel;
-            const description = {};
+            const description: Record<string, string> = {};
             Object.entries(log.list).map(entry => {
-                const key = entry[0];
+                const key: string = entry[0];
                 // eslint-disable-next-line @typescript-eslint/no-explicit-any
                 const value: any = entry[1];
                 if(value.displayValue) {
diff --git a/src/utils/singleNotify.ts b/src/utils/singleNotify.ts
index 44bb2d0..7339129 100644
--- a/src/utils/singleNotify.ts
+++ b/src/utils/singleNotify.ts
@@ -1,13 +1,15 @@
 import client from "./client.js";
 import EmojiEmbed from "./generateEmojiEmbed.js";
+import { Record as ImmutableRecord } from "immutable";
 
-const severities = {
+const severitiesType = ImmutableRecord({
     "Critical": "Danger",
     "Warning": "Warning",
     "Info": "Success"
-};
+} as Record<string, "Danger" | "Warning" | "Success">);
+const severities = severitiesType();
 
-export default async function(type: string, guild: string, message: string | true, severity?: string) {
+export default async function(type: string, guild: string, message: string | true, severity: "Critical" | "Warning" | "Info" = "Info") {
     const data = await client.database.guilds.read(guild);
     if (message === true) {
         return await client.database.guilds.write(guild, {[`singleEventNotifications.${type}`]: false});
@@ -20,7 +22,7 @@
         await channel.send({embeds: [new EmojiEmbed()
             .setTitle(`${severity} notification`)
             .setDescription(message)
-            .setStatus(severities[severity])
+            .setStatus(severities.get(severity))
             .setEmoji("CONTROL.BLOCKCROSS")
         ]});
     } catch (err) {
