styling fixes and some typing
diff --git a/src/commands/mod/info.ts b/src/commands/mod/info.ts
index af30989..f0257f8 100644
--- a/src/commands/mod/info.ts
+++ b/src/commands/mod/info.ts
@@ -1,12 +1,16 @@
-import { HistorySchema } from "../../utils/database.js";
+import type { HistorySchema } from "../../utils/database.js";
 import Discord, {
     CommandInteraction,
     GuildMember,
+    Interaction,
+    Message,
     MessageActionRow,
     MessageButton,
+    MessageComponentInteraction,
+    ModalSubmitInteraction,
     TextInputComponent
 } from "discord.js";
-import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import getEmojiByName from "../../utils/getEmojiByName.js";
 import client from "../../utils/client.js";
@@ -21,7 +25,7 @@
             option.setName("user").setDescription("The user to get information about").setRequired(true)
         );
 
-const types = {
+const types: Record<string, { emoji: string; text: string }> = {
     warn: { emoji: "PUNISH.WARN.YELLOW", text: "Warned" },
     mute: { emoji: "PUNISH.MUTE.YELLOW", text: "Muted" },
     unmute: { emoji: "PUNISH.MUTE.GREEN", text: "Unmuted" },
@@ -36,8 +40,9 @@
 };
 
 function historyToString(history: HistorySchema) {
-    let s = `${getEmojiByName(types[history.type].emoji)} ${history.amount ? history.amount + " " : ""}${
-        types[history.type].text
+    if (!Object.keys(types).includes(history.type)) throw new Error("Invalid history type");
+    let s = `${getEmojiByName(types[history.type]!.emoji)} ${history.amount ? history.amount + " " : ""}${
+        types[history.type]!.text
     } on <t:${Math.round(history.occurredAt.getTime() / 1000)}:F>`;
     if (history.moderator) {
         s += ` by <@${history.moderator}>`;
@@ -55,7 +60,7 @@
 }
 
 class TimelineSection {
-    name: string;
+    name: string = "";
     content: { data: HistorySchema; rendered: string }[] = [];
 
     addContent = (content: { data: HistorySchema; rendered: string }) => {
@@ -66,8 +71,8 @@
         return this.content.reduce((acc, cur) => acc + cur.rendered.length, 0);
     };
     generateName = () => {
-        const first = Math.round(this.content[0].data.occurredAt.getTime() / 1000);
-        const last = Math.round(this.content[this.content.length - 1].data.occurredAt.getTime() / 1000);
+        const first = Math.round(this.content[0]!.data.occurredAt.getTime() / 1000);
+        const last = Math.round(this.content[this.content.length - 1]!.data.occurredAt.getTime() / 1000);
         if (first === last) {
             return (this.name = `<t:${first}:F>`);
         }
@@ -90,30 +95,36 @@
     "December"
 ];
 
-async function showHistory(member, interaction: CommandInteraction) {
+async function showHistory(member: Discord.GuildMember, interaction: CommandInteraction) {
     let currentYear = new Date().getFullYear();
-    let pageIndex = null;
-    let m, history, current;
+    let pageIndex: number | null = null;
+    let history, current: TimelineSection;
+    let m: Message;
     let refresh = true;
-    let filteredTypes = [];
+    let filteredTypes: string[] = [];
     let openFilterPane = false;
     while (true) {
         if (refresh) {
             history = await client.database.history.read(member.guild.id, member.id, currentYear);
-            history = history.sort((a, b) => b.occurredAt.getTime() - a.occurredAt.getTime()).reverse();
+            history = history
+                .sort(
+                    (a: { occurredAt: Date }, b: { occurredAt: Date }) =>
+                        b.occurredAt.getTime() - a.occurredAt.getTime()
+                )
+                .reverse();
             if (openFilterPane) {
                 let tempFilteredTypes = filteredTypes;
                 if (filteredTypes.length === 0) {
                     tempFilteredTypes = Object.keys(types);
                 }
-                history = history.filter((h) => tempFilteredTypes.includes(h.type));
+                history = history.filter((h: { type: string }) => tempFilteredTypes.includes(h.type));
             }
             refresh = false;
         }
         const groups: TimelineSection[] = [];
         if (history.length > 0) {
             current = new TimelineSection();
-            history.forEach((event) => {
+            history.forEach((event: HistorySchema) => {
                 if (current.contentLength() + historyToString(event).length > 2000 || current.content.length === 5) {
                     groups.push(current);
                     current.generateName();
@@ -130,6 +141,7 @@
                 pageIndex = groups.length - 1;
             }
         }
+        if (pageIndex === null) pageIndex = 0;
         const components = (
             openFilterPane
                 ? [
@@ -192,8 +204,8 @@
             " " +
             currentYear.toString();
         if (groups.length > 0) {
-            const toRender = groups[Math.min(pageIndex, groups.length - 1)];
-            m = await interaction.editReply({
+            const toRender = groups[Math.min(pageIndex, groups.length - 1)]!;
+            m = (await interaction.editReply({
                 embeds: [
                     new EmojiEmbed()
                         .setEmoji("MEMBER.JOIN")
@@ -207,9 +219,9 @@
                         })
                 ],
                 components: components
-            });
+            })) as Message;
         } else {
-            m = await interaction.editReply({
+            m = (await interaction.editReply({
                 embeds: [
                     new EmojiEmbed()
                         .setEmoji("MEMBER.JOIN")
@@ -221,9 +233,9 @@
                         })
                 ],
                 components: components
-            });
+            })) as Message;
         }
-        let i;
+        let i: MessageComponentInteraction;
         try {
             i = await m.awaitMessageComponent({ time: 300000 });
         } catch (e) {
@@ -232,7 +244,7 @@
                     new EmojiEmbed()
                         .setEmoji("MEMBER.JOIN")
                         .setTitle("Moderation history for " + member.user.username)
-                        .setDescription(m.embeds[0].description)
+                        .setDescription(m.embeds[0]!.description!)
                         .setStatus("Danger")
                         .setFooter({ text: "Message timed out" })
                 ]
@@ -256,16 +268,16 @@
             refresh = true;
         }
         if (i.customId === "prevPage") {
-            pageIndex--;
-            if (pageIndex < 0) {
+            pageIndex!--;
+            if (pageIndex! < 0) {
                 pageIndex = null;
                 currentYear--;
                 refresh = true;
             }
         }
         if (i.customId === "nextPage") {
-            pageIndex++;
-            if (pageIndex >= groups.length) {
+            pageIndex!++;
+            if (pageIndex! >= groups.length) {
                 pageIndex = 0;
                 currentYear++;
                 refresh = true;
@@ -286,8 +298,8 @@
     }
 }
 
-const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
-    let m;
+const callback = async (interaction: CommandInteraction): Promise<unknown> => {
+    let m: Message;
     const member = interaction.options.getMember("user") as Discord.GuildMember;
     await interaction.reply({
         embeds: [new EmojiEmbed().setEmoji("NUCLEUS.LOADING").setTitle("Downloading Data").setStatus("Danger")],
@@ -302,7 +314,7 @@
             await showHistory(member, interaction);
         }
         firstLoad = false;
-        m = await interaction.editReply({
+        m = (await interaction.editReply({
             embeds: [
                 new EmojiEmbed()
                     .setEmoji("MEMBER.JOIN")
@@ -324,8 +336,8 @@
                         .setEmoji(getEmojiByName("ICONS.HISTORY", "id"))
                 ])
             ]
-        });
-        let i;
+        })) as Message;
+        let i: MessageComponentInteraction;
         try {
             i = await m.awaitMessageComponent({ time: 300000 });
         } catch (e) {
@@ -370,13 +382,16 @@
             try {
                 out = await modalInteractionCollector(
                     m,
-                    (m) => m.channel.id === interaction.channel.id,
+                    (m: Interaction) =>
+                        (m as MessageComponentInteraction | ModalSubmitInteraction).channelId === interaction.channelId,
                     (m) => m.customId === "modify"
                 );
             } catch (e) {
-                continue;
+                break;
             }
-            if (out.fields) {
+            if (out === null) {
+                continue;
+            } else if (out instanceof ModalSubmitInteraction) {
                 const toAdd = out.fields.getTextInputValue("note") || null;
                 await client.database.notes.create(member.guild.id, member.id, toAdd);
             } else {
@@ -391,7 +406,8 @@
 
 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";
+    if (!member.permissions.has("MODERATE_MEMBERS"))
+        throw new Error("You do not have the *Moderate Members* permission");
     return true;
 };