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) {
