diff --git a/.eslintrc.json b/.eslintrc.json
index 165e759..7db4826 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -23,6 +23,8 @@
                 "caughtErrorsIgnorePattern": "^_"
             }
         ],
-        "@typescript-eslint/no-explicit-any": "error"
+        "@typescript-eslint/no-explicit-any": "error",
+        "@typescript-eslint/no-misused-promises": "error",
+        "@typescript-eslint/no-floating-promises": "error"
     }
 }
diff --git a/package.json b/package.json
index 1b22dfe..5a250a4 100644
--- a/package.json
+++ b/package.json
@@ -36,6 +36,7 @@
         "dev": "rm -rf dist && eslint src --fix && tsc && node --experimental-json-modules --enable-source-maps dist/index.js",
         "force-dev": "clear; rm -rf dist; tsc-suppress && node --experimental-json-modules --enable-source-maps dist/index.js",
         "lint": "echo 'Style checking...'; prettier --check .; echo 'Linting...'; eslint src; echo 'To auto-fix everything possible, please run `yarn lint-fix`'; true",
+        "lint-no-stylecheck": "echo 'Linting...'; eslint src; echo 'A full lint and style check is required for PRs to be accepted. Please run `yarn lint` before committing'; true",
         "lint-fix": "echo 'Fixing eslint issues...'; eslint src --fix; echo 'Reformatting...'; prettier --write --loglevel warn --cache .; true",
         "lint-list": "echo 'Style checking...'; prettier --check .; echo 'Linting...'; eslint src; echo 'To view errors in more detail, please run `yarn lint`'; true",
         "lint-ci": "echo 'Style checking...' && prettier --check . && echo 'Linting...' && eslint src",
diff --git a/src/actions/createModActionTicket.ts b/src/actions/createModActionTicket.ts
index ea85255..6b34739 100644
--- a/src/actions/createModActionTicket.ts
+++ b/src/actions/createModActionTicket.ts
@@ -115,8 +115,8 @@
             type: Discord.ChannelType.PrivateThread,
             reason: "Creating ticket"
         })) as Discord.PrivateThreadChannel;
-        c.members.add(user.id);
-        c.members.add(createdBy.id);
+        await c.members.add(user.id);
+        await c.members.add(createdBy.id);
         try {
             await c.send({
                 content:
@@ -174,7 +174,7 @@
             guild: guild.id
         }
     };
-    log(data);
+    await log(data);
     return c.id;
 }
 
diff --git a/src/actions/roleMenu.ts b/src/actions/roleMenu.ts
index 9796b28..6997393 100644
--- a/src/actions/roleMenu.ts
+++ b/src/actions/roleMenu.ts
@@ -175,7 +175,7 @@
                 console.log(e);
                 return;
             }
-            component.deferUpdate();
+            await component.deferUpdate();
         }
     }
 
@@ -246,7 +246,7 @@
             console.log(e);
             return;
         }
-        component.deferUpdate();
+        await component.deferUpdate();
         if (component.customId === "back") {
             page = Math.max(0, page - 1);
         } else if (component.customId === "next") {
diff --git a/src/actions/tickets/create.ts b/src/actions/tickets/create.ts
index 26236d8..8dafe52 100644
--- a/src/actions/tickets/create.ts
+++ b/src/actions/tickets/create.ts
@@ -155,7 +155,7 @@
                 new ActionRowBuilder<ButtonBuilder>().addComponents(formattedTicketTypes.slice(i, i + 5))
             );
         }
-        component.update({
+        await component.update({
             embeds: [
                 new EmojiEmbed()
                     .setTitle("Create Ticket")
@@ -280,7 +280,7 @@
             type: Discord.ChannelType.PrivateThread,
             reason: "Creating ticket"
         })) as Discord.PrivateThreadChannel;
-        c.members.add(interaction.member!.user.id);
+        await c.members.add(interaction.member!.user.id);
         try {
             await c.send({
                 content:
@@ -357,7 +357,7 @@
             guild: interaction.guild.id
         }
     };
-    log(data);
+    await log(data);
     await interaction.editReply({
         embeds: [
             new EmojiEmbed()
diff --git a/src/actions/tickets/delete.ts b/src/actions/tickets/delete.ts
index 1c1e464..7e52458 100644
--- a/src/actions/tickets/delete.ts
+++ b/src/actions/tickets/delete.ts
@@ -78,7 +78,7 @@
                 guild: interaction.guild.id
             }
         };
-        log(data);
+        await log(data);
 
         await channel.delete();
     } else if (status === "Active") {
@@ -86,12 +86,12 @@
         // Archive the ticket
         await interaction.channel.fetch();
         if (channel.isThread()) {
-            channel.setName(`${channel.name.replace("Active", "Archived")}`);
-            channel.members.remove(channel.name.split(" - ")[1]!);
+            await channel.setName(`${channel.name.replace("Active", "Archived")}`);
+            await channel.members.remove(channel.name.split(" - ")[1]!);
         } else {
-            channel.setTopic(`${(channel.topic ?? "").replace("Active", "Archived")}`);
+            await channel.setTopic(`${(channel.topic ?? "").replace("Active", "Archived")}`);
             if (!channel.topic!.includes("Archived")) {
-                channel.setTopic("0 Archived");
+                await channel.setTopic("0 Archived");
             }
             await channel.permissionOverwrites.delete(channel.topic!.split(" ")[0]!);
         }
@@ -153,7 +153,7 @@
                 guild: interaction.guild.id
             }
         };
-        log(data);
+        await log(data);
     }
     return;
 }
@@ -170,28 +170,28 @@
     if (tickets.type === Discord.ChannelType.GuildCategory) {
         // For channels, the topic is the user ID, then the word Active
         const category = tickets as Discord.CategoryChannel;
-        category.children.cache.forEach((element) => {
+        for (const [_id, element] of category.children.cache) {
             if (!(element.type === Discord.ChannelType.GuildText)) return;
             if (!((element as Discord.TextChannel).topic ?? "").includes(member)) return;
             try {
-                element.delete();
+                await element.delete();
                 deleted++;
             } catch (e) {
                 console.error(e);
             }
-        });
+        };
     } else {
         // For threads, the name is the users name, id, then the word Active
         const channel = tickets as Discord.TextChannel;
-        channel.threads.cache.forEach((element: Discord.ThreadChannel) => {
+        for (const [_id, element] of channel.threads.cache) {
             if (!element.name.includes(member)) return;
             try {
-                element.delete();
+                await element.delete();
                 deleted++;
             } catch (e) {
                 console.error(e);
             }
-        });
+        };
     }
     if (!deleted) return;
     const { log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
@@ -214,7 +214,7 @@
             guild: guild
         }
     };
-    log(data);
+    await log(data);
 }
 
 export { purgeByUser };
diff --git a/src/api/index.ts b/src/api/index.ts
index 4b849f1..41f281d 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -35,7 +35,7 @@
             await member.roles.add(client.verify[code]!.rID);
 
             const interaction = client.verify[code]!.interaction;
-            interaction.editReply({
+            await interaction.editReply({
                 embeds: [
                     new EmojiEmbed()
                         .setTitle("Verify")
@@ -70,7 +70,7 @@
                         guild: guild.id
                     }
                 };
-                log(data);
+                await log(data);
             } catch {
                 res.sendStatus(500);
             }
@@ -80,12 +80,12 @@
         }
     });
 
-    app.get("/verify/:code", jsonParser, function (req: express.Request, res: express.Response) {
+    app.get("/verify/:code", jsonParser, async function (req: express.Request, res: express.Response) {
         const code = req.params.code;
         if (client.verify[code]) {
             try {
                 const interaction = client.verify[code]!.interaction;
-                interaction.editReply({
+                await interaction.editReply({
                     embeds: [
                         new EmojiEmbed()
                             .setTitle("Verify")
@@ -124,12 +124,12 @@
         }
     });
 
-    app.get("/rolemenu/:code", jsonParser, function (req: express.Request, res: express.Response) {
+    app.get("/rolemenu/:code", jsonParser, async function (req: express.Request, res: express.Response) {
         const code = req.params.code;
         if (client.roleMenu[code] !== undefined) {
             try {
                 const interaction = client.roleMenu[code]!.interaction;
-                interaction.editReply({
+                await interaction.editReply({
                     embeds: [
                         new EmojiEmbed()
                             .setTitle("Roles")
diff --git a/src/commands/mod/about.ts b/src/commands/mod/about.ts
index 8736054..6f8b74c 100644
--- a/src/commands/mod/about.ts
+++ b/src/commands/mod/about.ts
@@ -266,7 +266,7 @@
                 }
             });
         } catch (e) {
-            interaction.editReply({
+            await interaction.editReply({
                 embeds: [
                     new EmojiEmbed()
                         .setEmoji("MEMBER.JOIN")
diff --git a/src/commands/mod/ban.ts b/src/commands/mod/ban.ts
index 91e074d..41d1252 100644
--- a/src/commands/mod/ban.ts
+++ b/src/commands/mod/ban.ts
@@ -126,7 +126,7 @@
         dmSent = false;
     }
     try {
-        member.ban({
+        await member.ban({
             deleteMessageSeconds: deleteDays * 24 * 60 * 60,
             reason: reason ?? "*No reason provided*"
         });
@@ -159,7 +159,7 @@
                 guild: interaction.guild.id
             }
         };
-        log(data);
+        await log(data);
     } catch {
         await interaction.editReply({
             embeds: [
diff --git a/src/commands/mod/kick.ts b/src/commands/mod/kick.ts
index 4ef78c8..f9242fe 100644
--- a/src/commands/mod/kick.ts
+++ b/src/commands/mod/kick.ts
@@ -114,7 +114,7 @@
         dmSent = false;
     }
     try {
-        member.kick(reason || "No reason provided");
+        await member.kick(reason || "No reason provided");
         await client.database.history.create("kick", interaction.guild.id, member.user, interaction.user, reason);
         const { log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
         const timeInServer = member.joinedTimestamp
@@ -157,7 +157,7 @@
             data.list.joined = entry(member.joinedTimestamp.toString(), renderDelta(member.joinedTimestamp));
         }
         await client.database.history.create("kick", interaction.guild.id, member.user, interaction.user, reason);
-        log(data);
+        await log(data);
     } catch {
         await interaction.editReply({
             embeds: [
diff --git a/src/commands/mod/mute.ts b/src/commands/mod/mute.ts
index 2266a1a..0cfe660 100644
--- a/src/commands/mod/mute.ts
+++ b/src/commands/mod/mute.ts
@@ -132,7 +132,7 @@
         } catch {
             return;
         }
-        component.deferUpdate();
+        await component.deferUpdate();
         if (component.customId === "cancel")
             return interaction.editReply({
                 embeds: [
@@ -389,7 +389,7 @@
             guild: interaction.guild.id
         }
     };
-    log(data);
+    await log(data);
     const failed = !status.dm && notify;
     await interaction.editReply({
         embeds: [
diff --git a/src/commands/mod/nick.ts b/src/commands/mod/nick.ts
index cfdcf47..a8d4ab8 100644
--- a/src/commands/mod/nick.ts
+++ b/src/commands/mod/nick.ts
@@ -153,7 +153,7 @@
     let before: string | null;
     try {
         before = member.nickname;
-        member.setNickname(newNickname ?? null, "Nucleus Nickname command");
+        await member.setNickname(newNickname ?? null, "Nucleus Nickname command");
         await client.database.history.create(
             "nickname",
             interaction.guild!.id,
@@ -202,7 +202,7 @@
             guild: interaction.guild!.id
         }
     };
-    log(data);
+    await log(data);
     const failed = !dmSent && notify;
     await interaction.editReply({
         embeds: [
diff --git a/src/commands/mod/purge.ts b/src/commands/mod/purge.ts
index dadab04..1170c33 100644
--- a/src/commands/mod/purge.ts
+++ b/src/commands/mod/purge.ts
@@ -100,7 +100,7 @@
             })) as Discord.Message;
             let component;
             try {
-                component = m.awaitMessageComponent({
+                component = await m.awaitMessageComponent({
                     filter: (i) => i.user.id === interaction.user.id && i.channel!.id === interaction.channel!.id,
                     time: 300000
                 });
@@ -108,12 +108,12 @@
                 timedOut = true;
                 continue;
             }
-            (await component).deferUpdate();
-            if ((await component).customId === "done") {
+            await component.deferUpdate();
+            if (component.customId === "done") {
                 amountSelected = true;
                 continue;
             }
-            const amount = parseInt((await component).customId);
+            const amount = parseInt(component.customId);
 
             let messages: Discord.Message[] = [];
             await (interaction.channel as TextChannel).messages.fetch({ limit: amount }).then(async (ms) => {
@@ -167,7 +167,7 @@
                 guild: interaction.guild.id
             }
         };
-        log(data);
+        await log(data);
         const newOut = await client.database.transcripts.createTranscript(
             "purge",
             deleted,
@@ -209,7 +209,7 @@
             return;
         }
         if (component.customId === "download") {
-            interaction.editReply({
+            await interaction.editReply({
                 embeds: [
                     new EmojiEmbed()
                         .setEmoji("CHANNEL.PURGE.GREEN")
@@ -221,7 +221,7 @@
                 files: [attachmentObject]
             });
         } else {
-            interaction.editReply({
+            await interaction.editReply({
                 embeds: [
                     new EmojiEmbed()
                         .setEmoji("CHANNEL.PURGE.GREEN")
@@ -261,12 +261,12 @@
                 messages = await (channel as TextChannel).bulkDelete(toDelete, true);
             } else {
                 const toDelete = (
-                    await (
-                        await (interaction.channel as TextChannel).messages.fetch({
-                            limit: 100
-                        })
-                    ).filter((m) => m.author.id === user.id)
-                ).first(interaction.options.get("amount")?.value as number);
+                    await (interaction.channel as TextChannel).messages.fetch({
+                        limit: 100
+                    })
+                )
+                    .filter((m) => m.author.id === user.id)
+                    .first(interaction.options.get("amount")?.value as number);
                 messages = await (channel as TextChannel).bulkDelete(toDelete, true);
             }
         } catch (e) {
@@ -326,7 +326,7 @@
                 guild: interaction.guild.id
             }
         };
-        log(data);
+        await log(data);
         const messageArray: Message[] = messages
             .filter(
                 (message) =>
diff --git a/src/commands/mod/slowmode.ts b/src/commands/mod/slowmode.ts
index ba88c00..8fe9f16 100644
--- a/src/commands/mod/slowmode.ts
+++ b/src/commands/mod/slowmode.ts
@@ -51,7 +51,7 @@
         .send();
     if (confirmation.cancelled || !confirmation.success) return;
     try {
-        (interaction.channel as TextChannel).setRateLimitPerUser(time);
+        await (interaction.channel as TextChannel).setRateLimitPerUser(time);
     } catch (e) {
         await interaction.editReply({
             embeds: [
diff --git a/src/commands/mod/softban.ts b/src/commands/mod/softban.ts
index cd03d1a..984bb6b 100644
--- a/src/commands/mod/softban.ts
+++ b/src/commands/mod/softban.ts
@@ -128,7 +128,7 @@
     try {
         const member = interaction.options.getMember("user") as GuildMember;
         const days: number = (interaction.options.get("delete")?.value as number | null) ?? 0;
-        member.ban({
+        await member.ban({
             deleteMessageSeconds: days * 24 * 60 * 60,
             reason: reason ?? "*No reason provided*"
         });
@@ -162,7 +162,7 @@
                 guild: interaction.guild.id
             }
         };
-        log(data);
+        await log(data);
     } catch {
         await interaction.editReply({
             embeds: [
diff --git a/src/commands/mod/unban.ts b/src/commands/mod/unban.ts
index 7397414..1c1a877 100644
--- a/src/commands/mod/unban.ts
+++ b/src/commands/mod/unban.ts
@@ -76,7 +76,7 @@
                     guild: interaction.guild.id
                 }
             };
-            log(data);
+            await log(data);
         } catch {
             await interaction.editReply({
                 embeds: [
diff --git a/src/commands/mod/unmute.ts b/src/commands/mod/unmute.ts
index f248a3b..516bd39 100644
--- a/src/commands/mod/unmute.ts
+++ b/src/commands/mod/unmute.ts
@@ -76,7 +76,7 @@
     }
     const member = interaction.options.getMember("user") as GuildMember;
     try {
-        member.timeout(0, reason ?? "*No reason provided*");
+        await member.timeout(0, reason ?? "*No reason provided*");
     } catch {
         await interaction.editReply({
             embeds: [
@@ -122,7 +122,7 @@
             guild: interaction.guild.id
         }
     };
-    log(data);
+    await log(data);
     const failed = !dmSent && notify;
     await interaction.editReply({
         embeds: [
diff --git a/src/commands/mod/warn.ts b/src/commands/mod/warn.ts
index 232219b..0424d48 100644
--- a/src/commands/mod/warn.ts
+++ b/src/commands/mod/warn.ts
@@ -153,7 +153,7 @@
         }
     };
     await client.database.history.create("warn", interaction.guild.id, member.user, interaction.user, reason);
-    log(data);
+    await log(data);
     const failed = !dmSent && notify;
     if (!failed) {
         await interaction.editReply({
diff --git a/src/commands/nucleus/guide.ts b/src/commands/nucleus/guide.ts
index d05e265..c95e78c 100644
--- a/src/commands/nucleus/guide.ts
+++ b/src/commands/nucleus/guide.ts
@@ -6,7 +6,7 @@
     builder.setName("guide").setDescription("Shows the welcome guide for the bot");
 
 const callback = async (interaction: CommandInteraction) => {
-    guide(interaction.guild!, interaction);
+    await guide(interaction.guild!, interaction);
 };
 
 export { command };
diff --git a/src/commands/nucleus/invite.ts b/src/commands/nucleus/invite.ts
index 9f78cc5..0307c68 100644
--- a/src/commands/nucleus/invite.ts
+++ b/src/commands/nucleus/invite.ts
@@ -7,7 +7,7 @@
     builder.setName("invite").setDescription("Invites Nucleus to your server");
 
 const callback = async (interaction: CommandInteraction): Promise<void> => {
-    interaction.reply({
+    await interaction.reply({
         embeds: [
             new EmojiEmbed()
                 .setTitle("Invite")
diff --git a/src/commands/nucleus/ping.ts b/src/commands/nucleus/ping.ts
index 62988bb..8a9ca87 100644
--- a/src/commands/nucleus/ping.ts
+++ b/src/commands/nucleus/ping.ts
@@ -13,7 +13,7 @@
     const initial = Date.now();
     await interaction.reply({ embeds: LoadingEmbed, ephemeral: true });
     const ping = Date.now() - initial;
-    interaction.editReply({
+    await interaction.editReply({
         embeds: [
             new EmojiEmbed()
                 .setTitle("Ping")
diff --git a/src/commands/nucleus/premium.ts b/src/commands/nucleus/premium.ts
index 4effb23..f544045 100644
--- a/src/commands/nucleus/premium.ts
+++ b/src/commands/nucleus/premium.ts
@@ -106,7 +106,7 @@
     const member = await (await interaction.client.guilds.fetch("684492926528651336")).members
         .fetch(interaction.user.id)
         .catch(() => {
-            interaction.editReply({
+            void interaction.editReply({
                 embeds: [
                     new EmojiEmbed()
                         .setTitle("Premium")
@@ -197,7 +197,7 @@
     if ((dbMember?.appliesTo.length ?? 0) > 0)
         userPremiumServers = "\nIf you want to remove premium from a server, run this command in your DMs with me.";
 
-    interaction.editReply({
+    await interaction.editReply({
         embeds: [
             new EmojiEmbed()
                 .setTitle("Premium")
@@ -216,10 +216,10 @@
     } catch (e) {
         return;
     }
-    i.deferUpdate();
+    await i.deferUpdate();
     const guild = i.guild!;
     if (count - appliesTo.length <= 0) {
-        interaction.editReply({
+        await interaction.editReply({
             embeds: [
                 new EmojiEmbed()
                     .setTitle("Premium")
@@ -235,7 +235,7 @@
         });
     } else {
         await client.database.premium.addPremium(interaction.user.id, guild.id);
-        interaction.editReply({
+        await interaction.editReply({
             embeds: [
                 new EmojiEmbed()
                     .setTitle("Premium")
diff --git a/src/commands/nucleus/stats.ts b/src/commands/nucleus/stats.ts
index 294ee27..a7f9b3b 100644
--- a/src/commands/nucleus/stats.ts
+++ b/src/commands/nucleus/stats.ts
@@ -35,7 +35,7 @@
         fetchReply: true
     });
     if (config.owners.includes(interaction.user.id)) {
-        interaction.editReply({
+        await interaction.editReply({
             embeds: [
                 new EmojiEmbed()
                     .setTitle("Admin")
@@ -96,7 +96,7 @@
         } catch {
             return;
         }
-        out.deferUpdate();
+        await out.deferUpdate();
         const GuildID = out.fields.getTextInputValue("guildID");
         if (!client.guilds.cache.has(GuildID)) {
             await interaction.editReply({
@@ -126,7 +126,7 @@
         } catch {
             return;
         }
-        i.deferUpdate();
+        await i.deferUpdate();
         const guild = (await client.guilds.fetch(GuildID)) as Guild | null;
         if (!guild) {
             await interaction.editReply({
diff --git a/src/commands/privacy.ts b/src/commands/privacy.ts
index 590e866..3a671ed 100644
--- a/src/commands/privacy.ts
+++ b/src/commands/privacy.ts
@@ -214,7 +214,7 @@
             const em = new Discord.EmbedBuilder(pages[page]!.embed);
             em.setDescription(em.data.description + "\n\n" + createPageIndicator(pages.length, page));
             em.setFooter({ text: "Message closed" });
-            interaction.editReply({ embeds: [em], components: [] });
+            await interaction.editReply({ embeds: [em], components: [] });
             return;
         }
     }
diff --git a/src/commands/server/about.ts b/src/commands/server/about.ts
index 815b9e6..1857653 100644
--- a/src/commands/server/about.ts
+++ b/src/commands/server/about.ts
@@ -32,7 +32,7 @@
 const callback = async (interaction: CommandInteraction): Promise<void> => {
     const guild = interaction.guild!;
     const { renderUser, renderDelta } = client.logger;
-    interaction.reply({
+    await interaction.reply({
         embeds: [
             new EmojiEmbed()
                 .setTitle("Server Info")
diff --git a/src/commands/settings/automod.ts b/src/commands/settings/automod.ts
index d8464f0..6860a26 100644
--- a/src/commands/settings/automod.ts
+++ b/src/commands/settings/automod.ts
@@ -1076,12 +1076,12 @@
         } else {
             switch (i.values[0]) {
                 case "invites": {
-                    i.deferUpdate();
+                    await i.deferUpdate();
                     config.invite = await inviteMenu(i, m, config.invite);
                     break;
                 }
                 case "mentions": {
-                    i.deferUpdate();
+                    await i.deferUpdate();
                     config.pings = await mentionMenu(i, m, config.pings);
                     break;
                 }
diff --git a/src/commands/settings/rolemenu.ts b/src/commands/settings/rolemenu.ts
index e683e4f..7da9dfe 100644
--- a/src/commands/settings/rolemenu.ts
+++ b/src/commands/settings/rolemenu.ts
@@ -89,7 +89,7 @@
         out = null;
     }
     if (!out) return;
-    out.deferUpdate();
+    await out.deferUpdate();
     if (out.isButton()) return;
     const values = out.values;
 
@@ -218,7 +218,7 @@
                     `**Max:** ${data.max}\n`
             );
 
-        interaction.editReply({ embeds: [embed], components: [previewSelect, buttons] });
+        await interaction.editReply({ embeds: [embed], components: [previewSelect, buttons] });
         let i: StringSelectMenuInteraction | ButtonInteraction;
         try {
             i = (await m.awaitMessageComponent({
@@ -304,7 +304,7 @@
                     }\n`
             );
 
-        interaction.editReply({
+        await interaction.editReply({
             embeds: [embed],
             components: [new ActionRowBuilder<RoleSelectMenuBuilder>().addComponents(roleSelect), buttons]
         });
diff --git a/src/commands/settings/stats.ts b/src/commands/settings/stats.ts
index d4e4439..ed2fc6f 100644
--- a/src/commands/settings/stats.ts
+++ b/src/commands/settings/stats.ts
@@ -198,7 +198,7 @@
                             )
                         ]
                     });
-                    showModal(i, { name: newChannelName, enabled: newChannelEnabled });
+                    await showModal(i, { name: newChannelName, enabled: newChannelEnabled });
 
                     const out: Discord.ModalSubmitInteraction | ButtonInteraction | null =
                         await modalInteractionCollector(m, interaction.user);
@@ -336,7 +336,7 @@
             }
         }
 
-        interaction.editReply({
+        await interaction.editReply({
             embeds: [embed],
             components: [
                 new ActionRowBuilder<StringSelectMenuBuilder>().addComponents(pageSelect),
@@ -367,7 +367,7 @@
                     modified = true;
                     switch (i.values[0]!) {
                         case "edit": {
-                            showModal(i, current!);
+                            await showModal(i, current!);
                             await interaction.editReply({
                                 embeds: [
                                     new EmojiEmbed()
@@ -439,7 +439,7 @@
                 }
                 case "save": {
                     await client.database.guilds.write(interaction.guild.id, { stats: currentObject });
-                    singleNotify("statsChannelDeleted", interaction.guild.id, true);
+                    await singleNotify("statsChannelDeleted", interaction.guild.id, true);
                     modified = false;
                     await client.memory.forceUpdate(interaction.guild.id);
                     break;
diff --git a/src/commands/settings/tracks.ts b/src/commands/settings/tracks.ts
index 625bcfb..60a7eae 100644
--- a/src/commands/settings/tracks.ts
+++ b/src/commands/settings/tracks.ts
@@ -142,7 +142,7 @@
         out = null;
     }
     if (!out) return;
-    out.deferUpdate();
+    await out.deferUpdate();
     if (out.isButton()) return;
     const values = out.values;
 
@@ -268,7 +268,7 @@
         ];
         if (current.track.length >= 1) comps.splice(1, 0, selectMenu);
 
-        interaction.editReply({ embeds: [embed], components: comps });
+        await interaction.editReply({ embeds: [embed], components: comps });
 
         let out: ButtonInteraction | RoleSelectMenuInteraction | StringSelectMenuInteraction | null;
 
@@ -286,7 +286,7 @@
         if (out.isButton()) {
             switch (out.customId) {
                 case "back": {
-                    out.deferUpdate();
+                    await out.deferUpdate();
                     closed = true;
                     break;
                 }
@@ -295,23 +295,23 @@
                     break;
                 }
                 case "reorder": {
-                    out.deferUpdate();
+                    await out.deferUpdate();
                     current.track = (await reorderTracks(interaction, out, message, roles, current.track))!;
                     break;
                 }
                 case "retainPrevious": {
-                    out.deferUpdate();
+                    await out.deferUpdate();
                     current.retainPrevious = !current.retainPrevious;
                     break;
                 }
                 case "nullable": {
-                    out.deferUpdate();
+                    await out.deferUpdate();
                     current.nullable = !current.nullable;
                     break;
                 }
             }
         } else if (out.isStringSelectMenu()) {
-            out.deferUpdate();
+            await out.deferUpdate();
             switch (out.customId) {
                 case "removeRole": {
                     const index = current.track.findIndex(
@@ -322,7 +322,7 @@
                 }
             }
         } else {
-            out.deferUpdate();
+            await out.deferUpdate();
             switch (out.customId) {
                 case "addRole": {
                     const role = out.values![0]!;
@@ -476,7 +476,7 @@
                     break;
                 }
                 case "save": {
-                    client.database.guilds.write(interaction.guild!.id, { tracks: tracks });
+                    await client.database.guilds.write(interaction.guild!.id, { tracks: tracks });
                     modified = false;
                     await client.memory.forceUpdate(interaction.guild!.id);
                     break;
diff --git a/src/commands/settings/verify.ts b/src/commands/settings/verify.ts
index e2318fc..05c4764 100644
--- a/src/commands/settings/verify.ts
+++ b/src/commands/settings/verify.ts
@@ -82,7 +82,7 @@
         if (i.isButton()) {
             switch (i.customId) {
                 case "save": {
-                    client.database.guilds.write(interaction.guild.id, { verify: data });
+                    await client.database.guilds.write(interaction.guild.id, { verify: data });
                     config = await client.database.guilds.read(interaction.guild.id);
                     data = Object.assign({}, config.verify);
                     await client.memory.forceUpdate(interaction.guild.id);
diff --git a/src/commands/user/role.ts b/src/commands/user/role.ts
index 74b6c41..9a0a462 100644
--- a/src/commands/user/role.ts
+++ b/src/commands/user/role.ts
@@ -129,7 +129,7 @@
             continue;
         }
 
-        i.deferUpdate();
+        await i.deferUpdate();
         if (i.isButton()) {
             switch (i.customId) {
                 case "roleSave": {
diff --git a/src/commands/user/track.ts b/src/commands/user/track.ts
index 19b9da2..ee69868 100644
--- a/src/commands/user/track.ts
+++ b/src/commands/user/track.ts
@@ -178,7 +178,7 @@
             timedOut = true;
             continue;
         }
-        component.deferUpdate();
+        await component.deferUpdate();
         if (component.customId === "conflict") {
             const rolesToRemove = selected.filter(
                 (role) => role !== (component as StringSelectMenuInteraction).values[0]
diff --git a/src/commands/verify.ts b/src/commands/verify.ts
index 0dd8b24..4bbe50f 100644
--- a/src/commands/verify.ts
+++ b/src/commands/verify.ts
@@ -5,7 +5,7 @@
 const command = new SlashCommandBuilder().setName("verify").setDescription("Get verified in the server");
 
 const callback = async (interaction: CommandInteraction): Promise<void> => {
-    verify(interaction);
+    await verify(interaction);
 };
 
 export { command };
diff --git a/src/context/messages/purgeto.ts b/src/context/messages/purgeto.ts
index 4f0ea1e..a75a281 100644
--- a/src/context/messages/purgeto.ts
+++ b/src/context/messages/purgeto.ts
@@ -19,14 +19,14 @@
 async function waitForButton(m: Discord.Message, member: Discord.GuildMember): Promise<boolean> {
     let component;
     try {
-        component = m.awaitMessageComponent({
+        component = await m.awaitMessageComponent({
             time: 200000,
             filter: (i) => i.user.id === member.id && i.channel!.id === m.channel.id && i.message.id === m.id
         });
     } catch (e) {
         return false;
     }
-    (await component).deferUpdate();
+    await component.deferUpdate();
     return true;
 }
 
@@ -210,7 +210,7 @@
             guild: interaction.guild!.id
         }
     };
-    log(data);
+    await log(data);
     const messages: Message[] = deleted
         .map((m) => m)
         .filter((m) => m instanceof Message)
diff --git a/src/events/channelCreate.ts b/src/events/channelCreate.ts
index 90a7f6d..8fd6b35 100644
--- a/src/events/channelCreate.ts
+++ b/src/events/channelCreate.ts
@@ -81,5 +81,5 @@
             guild: channel.guild.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/channelDelete.ts b/src/events/channelDelete.ts
index 8dffd38..b79c2da 100644
--- a/src/events/channelDelete.ts
+++ b/src/events/channelDelete.ts
@@ -123,5 +123,5 @@
             guild: channel.guild.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/channelUpdate.ts b/src/events/channelUpdate.ts
index 6491cc9..adfe87f 100644
--- a/src/events/channelUpdate.ts
+++ b/src/events/channelUpdate.ts
@@ -301,5 +301,5 @@
             guild: newChannel.guild.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/emojiCreate.ts b/src/events/emojiCreate.ts
index 96f7909..873defa 100644
--- a/src/events/emojiCreate.ts
+++ b/src/events/emojiCreate.ts
@@ -30,5 +30,5 @@
             guild: emoji.guild.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/emojiDelete.ts b/src/events/emojiDelete.ts
index 52822cb..21ade1d 100644
--- a/src/events/emojiDelete.ts
+++ b/src/events/emojiDelete.ts
@@ -31,5 +31,5 @@
             guild: emoji.guild.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/emojiUpdate.ts b/src/events/emojiUpdate.ts
index 173f5c5..236a799 100644
--- a/src/events/emojiUpdate.ts
+++ b/src/events/emojiUpdate.ts
@@ -37,5 +37,5 @@
             guild: newEmoji.guild.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/guildBanAdd.ts b/src/events/guildBanAdd.ts
index 6036ddf..c8f3446 100644
--- a/src/events/guildBanAdd.ts
+++ b/src/events/guildBanAdd.ts
@@ -9,7 +9,7 @@
 export async function callback(client: NucleusClient, ban: GuildBan) {
     const { log, isLogging, NucleusColors, entry, renderUser, renderDelta, getAuditLog } = client.logger;
     await statsChannelRemove(ban.user, ban.guild);
-    purgeByUser(ban.user.id, ban.guild.id);
+    await purgeByUser(ban.user.id, ban.guild.id);
     if (!(await isLogging(ban.guild.id, "guildMemberPunish"))) return;
     const auditLog: GuildAuditLogsEntry | undefined = (await getAuditLog(ban.guild, AuditLogEvent.MemberBanAdd)).filter(
         (entry: GuildAuditLogsEntry) => (entry.target! as User).id === ban.user.id
@@ -39,5 +39,5 @@
             guild: ban.guild.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/guildBanRemove.ts b/src/events/guildBanRemove.ts
index fc916ba..64d9de3 100644
--- a/src/events/guildBanRemove.ts
+++ b/src/events/guildBanRemove.ts
@@ -33,5 +33,5 @@
             guild: ban.guild.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/guildCreate.ts b/src/events/guildCreate.ts
index ff6c6b2..f5e43a9 100644
--- a/src/events/guildCreate.ts
+++ b/src/events/guildCreate.ts
@@ -5,5 +5,5 @@
 export const event = "guildCreate";
 
 export async function callback(_client: NucleusClient, guild: Guild) {
-    guide(guild);
+    await guide(guild);
 }
diff --git a/src/events/guildMemberUpdate.ts b/src/events/guildMemberUpdate.ts
index 34a52b8..05b70b7 100644
--- a/src/events/guildMemberUpdate.ts
+++ b/src/events/guildMemberUpdate.ts
@@ -84,7 +84,7 @@
                 });
             }
             data = Object.assign(data, { list: list });
-            log(data);
+            await log(data);
         }
     }
     const auditLog = (await getAuditLog(after.guild, AuditLogEvent.MemberUpdate)).filter(
@@ -93,7 +93,7 @@
     if (!auditLog) return;
     if (auditLog.executor!.id === client.user!.id) return;
     if (before.nickname !== after.nickname) {
-        doMemberChecks(after, after.guild);
+        await doMemberChecks(after, after.guild);
         await client.database.history.create(
             "nickname",
             after.guild.id,
@@ -123,7 +123,7 @@
                 guild: after.guild.id
             }
         };
-        log(data);
+        await log(data);
     }
     if (
         (before.communicationDisabledUntilTimestamp ?? 0) < Date.now() &&
@@ -163,8 +163,8 @@
                 guild: after.guild.id
             }
         };
-        log(data);
-        client.database.eventScheduler.schedule("naturalUnmute", after.communicationDisabledUntil?.toISOString()!, {
+        await log(data);
+        await client.database.eventScheduler.schedule("naturalUnmute", after.communicationDisabledUntil?.toISOString()!, {
             guild: after.guild.id,
             user: after.id,
             expires: after.communicationDisabledUntilTimestamp
@@ -204,8 +204,8 @@
                 guild: after.guild.id
             }
         };
-        log(data);
-        client.database.eventScheduler.cancel("naturalUnmute", {
+        await log(data);
+        await client.database.eventScheduler.cancel("naturalUnmute", {
             guild: after.guild.id,
             user: after.id,
             expires: before.communicationDisabledUntilTimestamp
diff --git a/src/events/guildUpdate.ts b/src/events/guildUpdate.ts
index c48c82f..27c609d 100644
--- a/src/events/guildUpdate.ts
+++ b/src/events/guildUpdate.ts
@@ -93,5 +93,5 @@
             guild: after.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/inviteCreate.ts b/src/events/inviteCreate.ts
index 240965c..6e28d95 100644
--- a/src/events/inviteCreate.ts
+++ b/src/events/inviteCreate.ts
@@ -33,5 +33,5 @@
             guild: invite.guild!.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/inviteDelete.ts b/src/events/inviteDelete.ts
index 81285c7..89bd226 100644
--- a/src/events/inviteDelete.ts
+++ b/src/events/inviteDelete.ts
@@ -33,5 +33,5 @@
             guild: invite.guild!.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/memberJoin.ts b/src/events/memberJoin.ts
index 66abe28..b01eb60 100644
--- a/src/events/memberJoin.ts
+++ b/src/events/memberJoin.ts
@@ -7,9 +7,9 @@
 export const event = "guildMemberAdd";
 
 export async function callback(client: NucleusClient, member: GuildMember) {
-    welcome(member);
-    statsChannelAdd(member.user, member.guild);
-    doMemberChecks(member, member.guild);
+    await welcome(member);
+    await statsChannelAdd(member.user, member.guild);
+    await 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);
@@ -33,5 +33,5 @@
             guild: member.guild.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/memberLeave.ts b/src/events/memberLeave.ts
index e80ea0b..1ca50c6 100644
--- a/src/events/memberLeave.ts
+++ b/src/events/memberLeave.ts
@@ -8,7 +8,7 @@
 
 export async function callback(client: NucleusClient, member: GuildMember) {
     const startTime = Date.now() - 10 * 1000;
-    purgeByUser(member.id, member.guild.id);
+    await purgeByUser(member.id, member.guild.id);
     await statsChannelRemove(member.user, member.guild);
     const { getAuditLog, isLogging, log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
     if (!(await isLogging(member.guild.id, "guildMemberUpdate"))) return;
@@ -95,5 +95,5 @@
             }
         };
     }
-    log(data);
+    await log(data);
 }
diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts
index 0281fa1..5369bf4 100644
--- a/src/events/messageCreate.ts
+++ b/src/events/messageCreate.ts
@@ -23,7 +23,11 @@
         if (message.channel.permissionsFor(message.guild.members.me!)!.has("ManageMessages")) {
             await message.crosspost();
         } else {
-            singleNotify(`Nucleus does not have Manage Messages in <#${message.channel.id}>`, message.guild.id, true);
+            await singleNotify(
+                `Nucleus does not have Manage Messages in <#${message.channel.id}>`,
+                message.guild.id,
+                true
+            );
         }
     }
 
@@ -71,7 +75,7 @@
         if (!config.filters.invite.allowed.channels.includes(message.channel.id)) {
             if (/(?:https?:\/\/)?discord(?:app)?\.(?:com\/invite|gg)\/[a-zA-Z0-9]+\/?/.test(content)) {
                 messageException(message.guild.id, message.channel.id, message.id);
-                message.delete();
+                await message.delete();
                 const data = {
                     meta: {
                         type: "messageDelete",
diff --git a/src/events/messageDelete.ts b/src/events/messageDelete.ts
index c29bfd0..b847400 100644
--- a/src/events/messageDelete.ts
+++ b/src/events/messageDelete.ts
@@ -68,5 +68,5 @@
             guild: message.guild!.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/messageEdit.ts b/src/events/messageEdit.ts
index 67796c7..9799dde 100644
--- a/src/events/messageEdit.ts
+++ b/src/events/messageEdit.ts
@@ -103,5 +103,5 @@
             guild: newMessage.guild.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/roleCreate.ts b/src/events/roleCreate.ts
index 9b900f8..ea85b4d 100644
--- a/src/events/roleCreate.ts
+++ b/src/events/roleCreate.ts
@@ -30,5 +30,5 @@
             guild: role.guild.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/roleDelete.ts b/src/events/roleDelete.ts
index e83d557..1802518 100644
--- a/src/events/roleDelete.ts
+++ b/src/events/roleDelete.ts
@@ -42,5 +42,5 @@
             guild: role.guild.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/roleUpdate.ts b/src/events/roleUpdate.ts
index 236bc0f..c15cf01 100644
--- a/src/events/roleUpdate.ts
+++ b/src/events/roleUpdate.ts
@@ -74,5 +74,5 @@
             guild: newRole.guild.id
         }
     }; // TODO: make our own page for this
-    log(data);
+    await log(data);
 }
diff --git a/src/events/stickerCreate.ts b/src/events/stickerCreate.ts
index 01944fc..bc8adb8 100644
--- a/src/events/stickerCreate.ts
+++ b/src/events/stickerCreate.ts
@@ -32,5 +32,5 @@
             guild: sticker.guild!.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/stickerDelete.ts b/src/events/stickerDelete.ts
index a348b73..7704c49 100644
--- a/src/events/stickerDelete.ts
+++ b/src/events/stickerDelete.ts
@@ -30,5 +30,5 @@
             guild: sticker.guild!.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/stickerUpdate.ts b/src/events/stickerUpdate.ts
index c42f775..4be1a3d 100644
--- a/src/events/stickerUpdate.ts
+++ b/src/events/stickerUpdate.ts
@@ -35,5 +35,5 @@
             guild: newSticker.guild!.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/threadCreate.ts b/src/events/threadCreate.ts
index cefaf3b..42cda47 100644
--- a/src/events/threadCreate.ts
+++ b/src/events/threadCreate.ts
@@ -44,5 +44,5 @@
             guild: thread.guild.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/threadDelete.ts b/src/events/threadDelete.ts
index ecbf4cf..fba6592 100644
--- a/src/events/threadDelete.ts
+++ b/src/events/threadDelete.ts
@@ -46,5 +46,5 @@
             guild: thread.guild.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/threadUpdate.ts b/src/events/threadUpdate.ts
index 510ec30..e28abf1 100644
--- a/src/events/threadUpdate.ts
+++ b/src/events/threadUpdate.ts
@@ -55,5 +55,5 @@
             guild: newThread.guild.id
         }
     };
-    log(data);
+    await log(data);
 }
diff --git a/src/events/webhookUpdate.ts b/src/events/webhookUpdate.ts
index 438c66e..c4a4efb 100644
--- a/src/events/webhookUpdate.ts
+++ b/src/events/webhookUpdate.ts
@@ -130,7 +130,7 @@
                 guild: channel.guild.id
             }
         };
-        log(data);
+        await log(data);
     } catch (e) {
         console.log(e);
     }
diff --git a/src/index.ts b/src/index.ts
index 50a1526..b3883a1 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -8,7 +8,7 @@
 
 client.on("ready", async () => {
     console.log(`Logged in as ${client.user!.tag}!`);
-    register();
+    await register();
     runServer(client);
     if (config.enableDevelopment) {
         client.fetchedCommands = await client.guilds.cache.get(config.developmentGuildID)?.commands.fetch()!;
diff --git a/src/premium/attachmentLogs.ts b/src/premium/attachmentLogs.ts
index e719f22..9bb216d 100644
--- a/src/premium/attachmentLogs.ts
+++ b/src/premium/attachmentLogs.ts
@@ -36,7 +36,7 @@
     if (await client.database.premium.hasPremium(message.guild.id)) {
         const channel = (await client.database.guilds.read(message.guild.id)).logging.attachments.channel;
         if (!channel) {
-            singleNotify(
+            await singleNotify(
                 "noAttachmentLogChannel",
                 message.guild.id,
                 `No channel set for attachment logging. You can set one with ${getCommandMentionByName(
@@ -48,7 +48,7 @@
         }
         const channelObj = await message.guild.channels.fetch(channel);
         if (!channelObj) {
-            singleNotify(
+            await singleNotify(
                 "attachmentLogChannelDeleted",
                 message.guild.id,
                 `Your attachment history channel was deleted or is not longer accessible. You can set a new one with ${getCommandMentionByName(
@@ -75,7 +75,7 @@
             ],
             files: attachments.map((file) => file.local)
         });
-        client.database.guilds.write(message.guild.id, {
+        await client.database.guilds.write(message.guild.id, {
             [`logging.attachments.saved.${message.channel.id}${message.id}`]: m.url
         });
         return { files: attachments, jump: m.url };
diff --git a/src/premium/createTranscript.ts b/src/premium/createTranscript.ts
index 7a1f57f..fa1f7a4 100644
--- a/src/premium/createTranscript.ts
+++ b/src/premium/createTranscript.ts
@@ -134,7 +134,7 @@
             guild: interaction.guild!.id
         }
     };
-    log(data);
+    await log(data);
     await interaction.channel.delete();
     return;
 }
diff --git a/src/reflex/guide.ts b/src/reflex/guide.ts
index 1901d34..59c12c7 100644
--- a/src/reflex/guide.ts
+++ b/src/reflex/guide.ts
@@ -353,12 +353,12 @@
             const em = new Discord.EmbedBuilder(pages[page]!.embed);
             em.setDescription(em.data.description + "\n\n" + createPageIndicator(pages.length, page));
             em.setFooter({ text: "Message closed" });
-            interaction.editReply({
+            await interaction.editReply({
                 embeds: [em],
                 components: []
             });
         } else {
-            m.delete();
+            await m.delete();
         }
     }
 };
diff --git a/src/reflex/scanners.ts b/src/reflex/scanners.ts
index 59bfa2a..23337ac 100644
--- a/src/reflex/scanners.ts
+++ b/src/reflex/scanners.ts
@@ -55,7 +55,7 @@
     } catch (e) {
         return { safe: true };
     }
-    client.database.scanCache.write(hash, "malware", malware);
+    await client.database.scanCache.write(hash, "malware", malware);
     return { safe: !malware };
 }
 
@@ -75,7 +75,7 @@
             console.error(err);
             return { safe: true, tags: [] };
         });
-    client.database.scanCache.write(link, "bad_link", scanned.safe ?? true, scanned.tags ?? []);
+    await client.database.scanCache.write(link, "bad_link", scanned.safe ?? true, scanned.tags ?? []);
     return {
         safe: scanned.safe ?? true,
         tags: scanned.tags ?? []
@@ -90,7 +90,7 @@
 
 export async function saveAttachment(link: string): Promise<[string, string]> {
     const image = await (await fetch(link)).arrayBuffer();
-    const fileName = generateFileName(link.split("/").pop()!.split(".").pop()!);
+    const fileName = await generateFileName(link.split("/").pop()!.split(".").pop()!);
     const enc = new TextDecoder("utf-8");
     writeFileSync(fileName, new DataView(image), "base64");
     return [fileName, createHash("sha512").update(enc.decode(image), "base64").digest("base64")];
diff --git a/src/reflex/statsChannelUpdate.ts b/src/reflex/statsChannelUpdate.ts
index e3c7a2a..f2650a8 100644
--- a/src/reflex/statsChannelUpdate.ts
+++ b/src/reflex/statsChannelUpdate.ts
@@ -12,7 +12,7 @@
 export async function callback(user: User, guild: Guild) {
     guild = await client.guilds.fetch(guild.id);
     const config = await client.database.guilds.read(guild.id);
-    Object.entries(config.stats).forEach(async ([channel, props]) => {
+    Object.entries(config.stats).forEach(([channel, props]) => void (async () => {
         if ((props as PropSchema).enabled) {
             let string = (props as PropSchema).name;
             if (!string) return;
@@ -41,5 +41,5 @@
                 console.error(e);
             }
         }
-    });
+    })());
 }
diff --git a/src/reflex/verify.ts b/src/reflex/verify.ts
index a5991de..540fb4d 100644
--- a/src/reflex/verify.ts
+++ b/src/reflex/verify.ts
@@ -208,7 +208,7 @@
                     .setEmoji("CONTROL.BLOCKCROSS")
             ]
         });
-        singleNotify(
+        await singleNotify(
             "verifyRoleDeleted",
             interaction.guild!.id,
             `The role given when a member is verified has been deleted. Use ${getCommandMentionByName(
diff --git a/src/reflex/welcome.ts b/src/reflex/welcome.ts
index 8e471c6..33f1651 100644
--- a/src/reflex/welcome.ts
+++ b/src/reflex/welcome.ts
@@ -45,7 +45,7 @@
                         content: (config.welcome.ping ? `<@&${config.welcome.ping}>` : "") + `<@${member.id}>`
                     });
                 } catch (err) {
-                    singleNotify(
+                    await singleNotify(
                         "welcomeChannelDeleted",
                         member.guild.id,
                         `The welcome channel has been deleted or is no longer accessible. Use ${getCommandMentionByName(
diff --git a/src/utils/commandRegistration/register.ts b/src/utils/commandRegistration/register.ts
index fbd052f..22c2fbd 100644
--- a/src/utils/commandRegistration/register.ts
+++ b/src/utils/commandRegistration/register.ts
@@ -181,11 +181,11 @@
     client.on("interactionCreate", async (interaction: Interaction) => {
         if (interaction.isUserContextMenuCommand()) {
             const commandName = "contextCommands/user/" + interaction.commandName;
-            execute(client.commands[commandName]![0]?.check, client.commands[commandName]![0]?.callback, interaction);
+            await execute(client.commands[commandName]![0]?.check, client.commands[commandName]![0]?.callback, interaction);
             return;
         } else if (interaction.isMessageContextMenuCommand()) {
             const commandName = "contextCommands/message/" + interaction.commandName;
-            execute(client.commands[commandName]![0]?.check, client.commands[commandName]![0]?.callback, interaction);
+            await execute(client.commands[commandName]![0]?.check, client.commands[commandName]![0]?.callback, interaction);
             return;
         } else if (interaction.isAutocomplete()) {
             const commandName = interaction.commandName;
@@ -203,7 +203,7 @@
             const formatted = (choices ?? []).map((choice) => {
                 return { name: choice, value: choice };
             });
-            interaction.respond(formatted);
+            await interaction.respond(formatted);
         } else if (interaction.isChatInputCommand()) {
             const commandName = interaction.commandName;
             const subcommandGroupName = interaction.options.getSubcommandGroup(false);
@@ -219,7 +219,7 @@
             const command = client.commands[fullCommandName]![0];
             const callback = command?.callback;
             const check = command?.check;
-            execute(check, callback, interaction);
+            await execute(check, callback, interaction);
         }
     });
 }
diff --git a/src/utils/confirmationMessage.ts b/src/utils/confirmationMessage.ts
index 7b3bd31..a417f6f 100644
--- a/src/utils/confirmationMessage.ts
+++ b/src/utils/confirmationMessage.ts
@@ -228,7 +228,7 @@
                 break;
             }
             if (component.customId === "yes") {
-                component.deferUpdate();
+                await component.deferUpdate();
                 for (const v of Object.values(this.customButtons)) {
                     if (!v.active) continue;
                     try {
@@ -241,7 +241,7 @@
                 returnComponents = true;
                 continue;
             } else if (component.customId === "no") {
-                component.deferUpdate();
+                await component.deferUpdate();
                 success = false;
                 returnComponents = true;
                 continue;
@@ -348,7 +348,7 @@
                 returnComponents = true;
                 continue;
             } else {
-                component.deferUpdate();
+                await component.deferUpdate();
                 this.customButtons[component.customId]!.active = !this.customButtons[component.customId]!.active;
                 returnComponents = true;
                 continue;
diff --git a/src/utils/database.ts b/src/utils/database.ts
index 3fc2333..51b2bca 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -268,7 +268,7 @@
 
         const doc = await this.transcripts.insertOne(Object.assign(transcript, { code: code }), collectionOptions);
         if (doc.acknowledged) {
-            client.database.eventScheduler.schedule(
+            await client.database.eventScheduler.schedule(
                 "deleteTranscript",
                 (Date.now() + 1000 * 60 * 60 * 24 * 7).toString(),
                 { guild: transcript.guild, code: code, iv: iv, key: key }
diff --git a/src/utils/dualCollector.ts b/src/utils/dualCollector.ts
index bf9b0c0..e96ff5d 100644
--- a/src/utils/dualCollector.ts
+++ b/src/utils/dualCollector.ts
@@ -32,11 +32,7 @@
                     time: 300000
                 })
                 .on("collect", (m) => {
-                    try {
-                        m.delete();
-                    } catch (e) {
-                        client.emit("error", e as Error);
-                    }
+                    void m.delete().catch();
                     resolve(m);
                 });
             mes.on("end", () => {
diff --git a/src/utils/eventScheduler.ts b/src/utils/eventScheduler.ts
index 34bb28e..48eee63 100644
--- a/src/utils/eventScheduler.ts
+++ b/src/utils/eventScheduler.ts
@@ -79,13 +79,13 @@
                     guild: guild.id
                 }
             };
-            log(data);
+            await log(data);
         });
     }
 
     async start() {
         await new Promise((resolve) => this.agenda.once("ready", resolve));
-        this.agenda.start();
+        await this.agenda.start();
         return this;
     }
 
@@ -95,8 +95,8 @@
     }
 
     // eslint-disable-next-line @typescript-eslint/no-explicit-any
-    cancel(name: string, data: any) {
-        this.agenda.cancel({ name, data });
+    async cancel(name: string, data: any) {
+        await this.agenda.cancel({ name, data });
     }
 }
 
diff --git a/src/utils/log.ts b/src/utils/log.ts
index b29f365..8c8c0c9 100644
--- a/src/utils/log.ts
+++ b/src/utils/log.ts
@@ -127,7 +127,7 @@
                     )
                     .setTimestamp(log.meta.timestamp)
                     .setColor(log.meta.color);
-                channel.send({ embeds: [embed] });
+                await channel.send({ embeds: [embed] });
             }
         }
     },
diff --git a/src/utils/performanceTesting/record.ts b/src/utils/performanceTesting/record.ts
index 89f3ead..34ed206 100644
--- a/src/utils/performanceTesting/record.ts
+++ b/src/utils/performanceTesting/record.ts
@@ -14,7 +14,7 @@
     const user = guild.ownerId;
     const currentYear = new Date().getFullYear();
     const start = Date.now();
-    client.database.history.read(guild.id, user, currentYear - 1);
+    await client.database.history.read(guild.id, user, currentYear - 1);
     const end = Date.now();
     return end - start;
 };
@@ -35,7 +35,7 @@
         resources: await resources()
     };
     if (results.discord > 1000 || results.databaseRead > 500 || results.resources.cpu > 100) {
-        singleNotify(
+        await singleNotify(
             "performanceTest",
             config.developmentGuildID,
             `Discord ping time: \`${results.discord}ms\`\nDatabase read time: \`${
@@ -47,12 +47,12 @@
             config.owners
         );
     } else {
-        singleNotify("performanceTest", config.developmentGuildID, true);
+        await singleNotify("performanceTest", config.developmentGuildID, true);
     }
 
-    client.database.performanceTest.record(results);
-    setTimeout(async () => {
-        await record();
+    await client.database.performanceTest.record(results);
+    setTimeout(() => {
+        void record();
     }, 60 * 1000);
 };
 
diff --git a/src/utils/temp/generateFileName.ts b/src/utils/temp/generateFileName.ts
index 109478d..b95b347 100644
--- a/src/utils/temp/generateFileName.ts
+++ b/src/utils/temp/generateFileName.ts
@@ -6,13 +6,13 @@
 const __filename = fileURLToPath(import.meta.url);
 const __dirname = path.dirname(__filename);
 
-export default function generateFileName(ending: string): string {
+export default async function generateFileName(ending: string): Promise<string> {
     let fileName = crypto.randomBytes(35).toString("hex");
     fileName = fileName.replace(/([a-zA-Z0-9]{8})/g, "$1-");
     if (fs.existsSync(`./${fileName}`)) {
         fileName = generateFileName(ending);
     }
-    client.database.eventScheduler.schedule("deleteFile", (Date.now() + 60 * 1000).toString(), {
+    await client.database.eventScheduler.schedule("deleteFile", (Date.now() + 60 * 1000).toString(), {
         fileName: `${fileName}.${ending}`
     });
     return path.join(__dirname, fileName + "." + ending);
