diff --git a/src/commands/mod/info.ts b/src/commands/mod/info.ts
index 86a4c4a..9837273 100644
--- a/src/commands/mod/info.ts
+++ b/src/commands/mod/info.ts
@@ -1,4 +1,4 @@
-import { HistorySchema } from "../../utils/database";
+import { HistorySchema } from "../../utils/database.js";
 import Discord, {
     CommandInteraction,
     GuildMember,
diff --git a/src/commands/mod/mute.ts b/src/commands/mod/mute.ts
index 5be6f43..b430191 100644
--- a/src/commands/mod/mute.ts
+++ b/src/commands/mod/mute.ts
@@ -71,17 +71,15 @@
                 .setRequired(false)
         );
 
-const callback = async (
-    interaction: CommandInteraction
-): Promise<void | unknown> => {
+const callback = async (interaction: CommandInteraction): Promise<unknown> => {
     const { log, NucleusColors, renderUser, entry, renderDelta } =
         client.logger;
     const user = interaction.options.getMember("user") as GuildMember;
     const time = {
-        days: interaction.options.getInteger("days") || 0,
-        hours: interaction.options.getInteger("hours") || 0,
-        minutes: interaction.options.getInteger("minutes") || 0,
-        seconds: interaction.options.getInteger("seconds") || 0
+        days: interaction.options.getInteger("days") ?? 0,
+        hours: interaction.options.getInteger("hours") ?? 0,
+        minutes: interaction.options.getInteger("minutes") ?? 0,
+        seconds: interaction.options.getInteger("seconds") ?? 0
     };
     const config = await client.database.guilds.read(interaction.guild.id);
     let serverSettingsDescription = config.moderation.mute.timeout
diff --git a/src/commands/settings/logs/attachment.ts b/src/commands/settings/logs/attachment.ts
index f37bd1a..ea8aa51 100644
--- a/src/commands/settings/logs/attachment.ts
+++ b/src/commands/settings/logs/attachment.ts
@@ -1,5 +1,5 @@
 import { LoadingEmbed } from "./../../../utils/defaultEmbeds.js";
-import { ChannelType } from "discord-api-types";
+import { ChannelType } from "discord-api-types/v9";
 import Discord, {
     CommandInteraction,
     MessageActionRow,
diff --git a/src/commands/settings/logs/channel.ts b/src/commands/settings/logs/channel.ts
index 00d2411..fd64424 100644
--- a/src/commands/settings/logs/channel.ts
+++ b/src/commands/settings/logs/channel.ts
@@ -1,5 +1,5 @@
 import { LoadingEmbed } from "./../../../utils/defaultEmbeds.js";
-import { ChannelType } from "discord-api-types";
+import { ChannelType } from "discord-api-types/v9";
 import Discord, {
     CommandInteraction,
     MessageActionRow,
diff --git a/src/commands/settings/logs/staff.ts b/src/commands/settings/logs/staff.ts
index 718d13b..a0df97c 100644
--- a/src/commands/settings/logs/staff.ts
+++ b/src/commands/settings/logs/staff.ts
@@ -1,5 +1,5 @@
 import { LoadingEmbed } from "./../../../utils/defaultEmbeds.js";
-import { ChannelType } from "discord-api-types";
+import { ChannelType } from "discord-api-types/v9";
 import Discord, {
     CommandInteraction,
     MessageActionRow,
@@ -9,7 +9,6 @@
 import confirmationMessage from "../../../utils/confirmationMessage.js";
 import getEmojiByName from "../../../utils/getEmojiByName.js";
 import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-expect-error
 import type { WrappedCheck } from "jshaiku";
 import client from "../../../utils/client.js";
diff --git a/src/commands/settings/tickets.ts b/src/commands/settings/tickets.ts
index 5e5cbe7..206e157 100644
--- a/src/commands/settings/tickets.ts
+++ b/src/commands/settings/tickets.ts
@@ -19,7 +19,7 @@
     SelectMenuOption,
     SlashCommandSubcommandBuilder
 } from "@discordjs/builders";
-import { ChannelType } from "discord-api-types";
+import { ChannelType } from "discord-api-types/v9";
 import client from "../../utils/client.js";
 import {
     toHexInteger,
diff --git a/src/commands/settings/welcome.ts b/src/commands/settings/welcome.ts
index 3eb0ec5..00b1826 100644
--- a/src/commands/settings/welcome.ts
+++ b/src/commands/settings/welcome.ts
@@ -8,12 +8,12 @@
     MessageComponentInteraction,
     Role
 } from "discord.js";
-import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
 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 { ChannelType } from "discord-api-types/v9";
 import getEmojiByName from "../../utils/getEmojiByName.js";
 
 const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -49,9 +49,7 @@
                 .addChannelTypes([ChannelType.GuildText, ChannelType.GuildNews])
         );
 
-const callback = async (
-    interaction: CommandInteraction
-): Promise<void | unknown> => {
+const callback = async (interaction: CommandInteraction): Promise<unknown> => {
     const { renderRole, renderChannel, log, NucleusColors, entry, renderUser } =
         client.logger;
     await interaction.reply({
@@ -340,7 +338,9 @@
 const check = (interaction: CommandInteraction) => {
     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";
+        throw new Error(
+            "You must have the *Manage Server* permission to use this command"
+        );
     return true;
 };
 
diff --git a/src/commands/tags/edit.ts b/src/commands/tags/edit.ts
index 192a2d4..5aaec40 100644
--- a/src/commands/tags/edit.ts
+++ b/src/commands/tags/edit.ts
@@ -1,5 +1,5 @@
-import Discord, { CommandInteraction } from "discord.js";
-import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import type { CommandInteraction, GuildMember } from "discord.js";
+import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import confirmationMessage from "../../utils/confirmationMessage.js";
 import keyValueList from "../../utils/generateKeyValueList.js";
@@ -28,10 +28,11 @@
                 .setDescription("The new name of the tag / Edit")
         );
 
-const callback = async (interaction: CommandInteraction): Promise<void> => {
+const callback = async (interaction: CommandInteraction): Promise<unknown> => {
+    if (!interaction.guild) return;
     const name = interaction.options.getString("name");
-    const value = interaction.options.getString("value") || "";
-    const newname = interaction.options.getString("newname") || "";
+    const value = interaction.options.getString("value") ?? "";
+    const newname = interaction.options.getString("newname") ?? "";
     if (!newname && !value)
         return await interaction.reply({
             embeds: [
@@ -155,9 +156,11 @@
 };
 
 const check = (interaction: CommandInteraction) => {
-    const member = interaction.member as Discord.GuildMember;
+    const member = interaction.member as GuildMember;
     if (!member.permissions.has("MANAGE_MESSAGES"))
-        throw "You must have the *Manage Messages* permission to use this command";
+        throw new Error(
+            "You must have the *Manage Messages* permission to use this command"
+        );
     return true;
 };
 
diff --git a/src/commands/user/about.ts b/src/commands/user/about.ts
index 5f096ae..129359f 100644
--- a/src/commands/user/about.ts
+++ b/src/commands/user/about.ts
@@ -55,8 +55,9 @@
 }
 
 const callback = async (interaction: CommandInteraction): Promise<void> => {
+    if (!interaction.guild) return;
     const { renderUser, renderDelta } = client.logger;
-    const member = (interaction.options.getMember("user") ||
+    const member = (interaction.options.getMember("user") ??
         interaction.member) as Discord.GuildMember;
     const flags: string[] = [];
     if (
@@ -107,26 +108,29 @@
     };
     const members = await interaction.guild.members.fetch();
     const membersArray = [...members.values()];
-    membersArray.sort((a, b) => a.joinedTimestamp - b.joinedTimestamp);
+    membersArray.sort((a, b) => {
+        if (a.joinedTimestamp === null) return 1;
+        if (b.joinedTimestamp === null) return -1;
+        return a.joinedTimestamp - b.joinedTimestamp;
+    });
     const joinPos = membersArray.findIndex((m) => m.id === member.user.id);
 
     const roles = member.roles.cache
-        .filter((r) => r.id !== interaction.guild.id)
+        .filter((r) => r.id !== interaction.guild!.id)
         .sort();
     let s = "";
     let count = 0;
     let ended = false;
-    roles.map((item) => {
-        if (ended) return;
-        const string = `<@&${item.id}>, `;
+    for (const roleId in roles) {
+        const string = `<@&${roleId}>, `;
         if (s.length + string.length > 1000) {
             ended = true;
             s += `and ${roles.size - count} more`;
-            return;
+            break;
         }
         count++;
         s += string;
-    });
+    }
     if (s.length > 0 && !ended) s = s.slice(0, -2);
 
     let perms = "";
diff --git a/src/commands/user/avatar.ts b/src/commands/user/avatar.ts
index 35c475f..502e9c8 100644
--- a/src/commands/user/avatar.ts
+++ b/src/commands/user/avatar.ts
@@ -19,7 +19,7 @@
 
 const callback = async (interaction: CommandInteraction): Promise<void> => {
     const { renderUser } = client.logger;
-    const member = (interaction.options.getMember("user") ||
+    const member = (interaction.options.getMember("user") ??
         interaction.member) as Discord.GuildMember;
     await interaction.reply({
         embeds: [
@@ -33,7 +33,7 @@
                         url: member.user.displayAvatarURL({ dynamic: true })
                     })
                 )
-                .setImage(await member.user.displayAvatarURL({ dynamic: true }))
+                .setImage(member.user.displayAvatarURL({ dynamic: true }))
         ],
         ephemeral: true,
         fetchReply: true
diff --git a/src/commands/user/track.ts b/src/commands/user/track.ts
index e0e41e0..1a4c308 100644
--- a/src/commands/user/track.ts
+++ b/src/commands/user/track.ts
@@ -10,7 +10,6 @@
     SelectMenuOption,
     SlashCommandSubcommandBuilder
 } from "@discordjs/builders";
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-expect-error
 import { WrappedCheck } from "jshaiku";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
@@ -45,9 +44,7 @@
     return "TRACKS.VERTICAL.MIDDLE." + disabled + active;
 };
 
-const callback = async (
-    interaction: CommandInteraction
-): Promise<void | unknown> => {
+const callback = async (interaction: CommandInteraction): Promise<unknown> => {
     const { renderUser } = client.logger;
     const member = interaction.options.getMember("user") as GuildMember;
     const guild = interaction.guild;
@@ -57,7 +54,7 @@
     let track = 0;
     let generated;
     const roles = await guild.roles.fetch();
-    const memberRoles = await member.roles;
+    const memberRoles = member.roles;
     let managed: boolean;
     while (true) {
         const data = config.tracks[track];
@@ -137,9 +134,8 @@
                 })
                 .join("\n");
         const selected = [];
-        for (let i = 0; i < data.track.length; i++) {
-            if (memberRoles.cache.has(data.track[i]))
-                selected.push(data.track[i]);
+        for (const position of data.track) {
+            if (memberRoles.cache.has(position)) selected.push(position);
         }
         const conflict = data.retainPrevious ? false : selected.length > 1;
         let conflictDropdown;
@@ -278,7 +274,8 @@
 ) => {
     const tracks = (await client.database.guilds.read(interaction.guild.id))
         .tracks;
-    if (tracks.length === 0) throw "This server does not have any tracks";
+    if (tracks.length === 0)
+        throw new Error("This server does not have any tracks");
     const member = interaction.member as GuildMember;
     // Allow the owner to promote anyone
     if (member.id === interaction.guild.ownerId) return true;
@@ -297,7 +294,7 @@
     }
     // Check if the user has manage_roles permission
     if (!managed && !member.permissions.has("MANAGE_ROLES"))
-        throw "You do not have the *Manage Roles* permission";
+        throw new Error("You do not have the *Manage Roles* permission");
     // Allow track
     return true;
 };
diff --git a/src/commands/verify.ts b/src/commands/verify.ts
index d1a0659..2319284 100644
--- a/src/commands/verify.ts
+++ b/src/commands/verify.ts
@@ -1,6 +1,5 @@
 import type { CommandInteraction } from "discord.js";
 import { SlashCommandBuilder } from "@discordjs/builders";
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-expect-error
 import { WrappedCheck } from "jshaiku";
 import verify from "../reflex/verify.js";
