diff --git a/src/actions/tickets/delete.ts b/src/actions/tickets/delete.ts
index be891ec..990b360 100644
--- a/src/actions/tickets/delete.ts
+++ b/src/actions/tickets/delete.ts
@@ -87,10 +87,8 @@
                 new EmojiEmbed()
                     .setTitle("Archived Ticket")
                     .setDescription(`This ticket has been Archived. Type ${getCommandMentionByName("ticket/close")} to delete it.\n` +
-                        "Creating a transcript will delete all messages in this ticket" +
-                        hasPremium ?
-                        `\n\nFor more info on transcripts, check ${getCommandMentionByName("privacy")}` :
-                        "")
+                        hasPremium ? ("Creating a transcript will delete all messages in this ticket" +
+                        `\n\nFor more info on transcripts, check ${getCommandMentionByName("privacy")}`): "")
                     .setStatus("Warning")
                     .setEmoji("GUILD.TICKET.ARCHIVED")
             ],
diff --git a/src/api/index.ts b/src/api/index.ts
index 8c1e8cc..9676194 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -156,6 +156,8 @@
         if (entry === null) return res.status(404).send("Could not find a transcript by that code");
         // Convert to a human readable format
         const data = client.database.transcripts.toHumanReadable(entry);
+        res.attachment(`${code}.txt`);
+        res.type("txt");
         return res.status(200).send(data);
     });
 
@@ -168,6 +170,28 @@
         return res.status(200).send(entry);
     });
 
+    app.get("/channels/:id", jsonParser, async function (req: express.Request, res: express.Response) {
+        const id = req.params.id;
+        if (id === undefined) return res.status(400).send("No id provided");
+        const channel = await client.channels.fetch(id);
+        if (channel === null) return res.status(404).send("Could not find a channel by that id");
+        if (channel.isDMBased()) return res.status(400).send("Cannot get a DM channel");
+        return res.status(200).send(channel.name);
+    });
+
+    app.get("/users/:id", jsonParser, async function (req: express.Request, res: express.Response) {
+        const id = req.params.id;
+        if (id === undefined) return res.status(400).send("No id provided");
+        let user;
+        try {
+            user = await client.users.fetch(id);
+        } catch (e) {
+            console.log(e)
+            return res.status(404).send("Could not find a user by that id");
+        }
+        return res.status(200).send(user.username);
+    });
+
     app.listen(port);
 };
 
diff --git a/src/commands/settings/automod.ts b/src/commands/settings/automod.ts
index 87b1844..09b8914 100644
--- a/src/commands/settings/automod.ts
+++ b/src/commands/settings/automod.ts
@@ -650,19 +650,19 @@
     channels?: string[],
     allowed?: {
         roles: string[],
-        user: string[]
+        users: string[]
     }
 }): Promise<{
     channels: string[],
     allowed: {
         roles: string[],
-        user: string[]
+        users: string[]
     }
 }> => {
     let closed = false;
-    if(!current) current = {channels: [], allowed: {roles: [], user: []}};
+    if(!current) current = {channels: [], allowed: {roles: [], users: []}};
     if(!current.channels) current.channels = [];
-    if(!current.allowed) current.allowed = {roles: [], user: []};
+    if(!current.allowed) current.allowed = {roles: [], users: []};
 
     const channelMenu = new ActionRowBuilder<ChannelSelectMenuBuilder>()
         .addComponents(
@@ -773,7 +773,7 @@
                 case "allowed": {
                     switch (i.values[0]) {
                         case "users": {
-                            current.allowed.user = await toSelectMenu(interaction, m, current.allowed.user, "member", "Mention Settings");
+                            current.allowed.users = await toSelectMenu(interaction, m, current.allowed.users, "member", "Mention Settings");
                             break;
                         }
                         case "roles": {
@@ -792,7 +792,7 @@
         channels: string[],
         allowed: {
             roles: string[],
-            user: string[]
+            users: string[]
         }
     };
 
diff --git a/src/commands/settings/moderation.ts b/src/commands/settings/moderation.ts
index c7f0dd0..336e53a 100644
--- a/src/commands/settings/moderation.ts
+++ b/src/commands/settings/moderation.ts
@@ -21,6 +21,7 @@
     while (!timedOut) {
         const config = await client.database.guilds.read(interaction.guild!.id);
         const moderation = config.moderation;
+        console.log(moderation)
         await interaction.editReply({
             embeds: [
                 new EmojiEmbed()
diff --git a/src/config/default.json b/src/config/default.json
deleted file mode 100644
index 704896f..0000000
--- a/src/config/default.json
+++ /dev/null
@@ -1,122 +0,0 @@
-{
-    "id": "default",
-    "version": 1,
-    "singleEventNotifications": {
-        "statsChannelDeleted": false
-    },
-    "filters": {
-        "images": {
-            "NSFW": false,
-            "size": false
-        },
-        "malware": false,
-        "wordFilter": {
-            "enabled": false,
-            "words": {
-                "strict": [],
-                "loose": []
-            },
-            "allowed": {
-                "user": [],
-                "roles": [],
-                "channels": []
-            }
-        },
-        "invite": {
-            "enabled": false,
-            "allowed": {
-                "user": [],
-                "roles": [],
-                "channels": []
-            }
-        },
-        "pings": {
-            "mass": 5,
-            "everyone": true,
-            "roles": true,
-            "allowed": {
-                "user": [],
-                "roles": [],
-                "channels": [],
-                "rolesToMention": []
-            }
-        },
-        "clean": {
-            "channels": [],
-            "allowed": {
-                "user": [],
-                "roles": []
-            }
-        }
-    },
-    "welcome": {
-        "enabled": false,
-        "role": null,
-        "ping": null,
-        "channel": null,
-        "message": null
-    },
-    "stats": {},
-    "logging": {
-        "logs": {
-            "enabled": true,
-            "channel": null,
-            "toLog": "3fffff"
-        },
-        "staff": {
-            "channel": null
-        },
-        "attachments": {
-            "channel": null,
-            "saved": {}
-        }
-    },
-    "verify": {
-        "enabled": false,
-        "role": null
-    },
-    "tickets": {
-        "enabled": false,
-        "category": null,
-        "types": "3f",
-        "customTypes": null,
-        "useCustom": false,
-        "supportRole": null,
-        "maxTickets": 5
-    },
-    "moderation": {
-        "mute": {
-            "timeout": true,
-            "role": null,
-            "text": null,
-            "link": null
-        },
-        "kick": {
-            "text": null,
-            "link": null
-        },
-        "ban": {
-            "text": null,
-            "link": null
-        },
-        "softban": {
-            "text": null,
-            "link": null
-        },
-        "warn": {
-            "text": null,
-            "link": null
-        },
-        "nick": {
-            "text": null,
-            "link": null
-        }
-    },
-    "tracks": [],
-    "roleMenu": [],
-    "tags": {},
-    "autoPublish": {
-        "enabled": false,
-        "channels": []
-    }
-}
diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts
index 44017d7..4f525fc 100644
--- a/src/events/messageCreate.ts
+++ b/src/events/messageCreate.ts
@@ -28,7 +28,7 @@
     if(config.filters.clean.channels.includes(message.channel.id)) {
         const memberRoles = message.member!.roles.cache.map(role => role.id);
         const roleAllow = config.filters.clean.allowed.roles.some(role => memberRoles.includes(role));
-        const userAllow = config.filters.clean.allowed.user.includes(message.author.id);
+        const userAllow = config.filters.clean.allowed.users.includes(message.author.id);
         if(!roleAllow && !userAllow) return await message.delete();
     }
 
diff --git a/src/premium/createTranscript.ts b/src/premium/createTranscript.ts
index 85e059f..67aed04 100644
--- a/src/premium/createTranscript.ts
+++ b/src/premium/createTranscript.ts
@@ -86,7 +86,7 @@
         ],
         components: [
             new ActionRowBuilder<ButtonBuilder>().addComponents([
-                new ButtonBuilder().setLabel("View").setStyle(ButtonStyle.Link).setURL(`https://clicks.codes/nucleus/transcript?code=${code}`),
+                new ButtonBuilder().setLabel("View").setStyle(ButtonStyle.Link).setURL(`https://clicks.codes/nucleus/transcript/${code}`),
                 new ButtonBuilder()
                     .setLabel("Delete")
                     .setStyle(ButtonStyle.Danger)
@@ -118,7 +118,8 @@
         list: {
             ticketFor: entry(member.id, renderUser(member.user)),
             deletedBy: entry(interaction.member!.user.id, renderUser(interaction.member!.user as User)),
-            deleted: entry(Date.now().toString(), renderDelta(Date.now()))
+            deleted: entry(Date.now().toString(), renderDelta(Date.now())),
+            transcript: entry(code, `https://clicks.codes/nucleus/transcript/${code}`)
         },
         hidden: {
             guild: interaction.guild!.id
diff --git a/src/utils/client.ts b/src/utils/client.ts
index 7e84716..b1fa31f 100644
--- a/src/utils/client.ts
+++ b/src/utils/client.ts
@@ -41,7 +41,7 @@
     }
 }
 const client = new NucleusClient({
-    guilds: await new Guilds().setup(),
+    guilds: await new Guilds(),
     history: new History(),
     notes: new ModNotes(),
     premium: new Premium(),
diff --git a/src/utils/database.ts b/src/utils/database.ts
index 1e2d3ba..2e64320 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -4,7 +4,8 @@
 import config from "../config/main.js";
 import client from "../utils/client.js";
 import * as crypto from "crypto";
-
+import _ from "lodash";
+import defaultData from '../config/default.js';
 // config.mongoOptions.host, {
 //     auth: {
 //         username: config.mongoOptions.username,
@@ -23,27 +24,22 @@
 
 export class Guilds {
     guilds: Collection<GuildConfig>;
-    defaultData: GuildConfig | null;
+    defaultData: GuildConfig;
 
     constructor() {
         this.guilds = database.collection<GuildConfig>("guilds");
-        this.defaultData = null;
-    }
-
-    async setup(): Promise<Guilds> {
-        this.defaultData = (await import("../config/default.json", { assert: { type: "json" } }))
-            .default as unknown as GuildConfig;
-        return this;
+        this.defaultData = defaultData;
     }
 
     async read(guild: string): Promise<GuildConfig> {
-        console.log("Guild read")
+        // console.log("Guild read")
         const entry = await this.guilds.findOne({ id: guild });
-        return Object.assign({}, this.defaultData, entry);
+        const data = _.clone(this.defaultData!);
+        return _.merge(data, entry ?? {});
     }
 
     async write(guild: string, set: object | null, unset: string[] | string = []) {
-        console.log("Guild write")
+        // console.log("Guild write")
         // eslint-disable-next-line @typescript-eslint/no-explicit-any
         const uo: Record<string, any> = {};
         if (!Array.isArray(unset)) unset = [unset];
@@ -58,7 +54,7 @@
 
     // eslint-disable-next-line @typescript-eslint/no-explicit-any
     async append(guild: string, key: string, value: any) {
-        console.log("Guild append")
+        // console.log("Guild append")
         if (Array.isArray(value)) {
             await this.guilds.updateOne(
                 { id: guild },
@@ -85,7 +81,7 @@
         value: any,
         innerKey?: string | null
     ) {
-        console.log("Guild remove")
+        // console.log("Guild remove")
         if (innerKey) {
             await this.guilds.updateOne(
                 { id: guild },
@@ -114,7 +110,7 @@
     }
 
     async delete(guild: string) {
-        console.log("Guild delete")
+        // console.log("Guild delete")
         await this.guilds.deleteOne({ id: guild });
     }
 }
@@ -202,7 +198,7 @@
     }
 
     async create(transcript: Omit<TranscriptSchema, "code">) {
-        console.log("Transcript create")
+        // console.log("Transcript create")
         let code;
         do {
             code = crypto.randomBytes(64).toString("base64").replace(/=/g, "").replace(/\//g, "_").replace(/\+/g, "-");
@@ -214,7 +210,7 @@
     }
 
     async read(code: string) {
-        console.log("Transcript read")
+        // console.log("Transcript read")
         return await this.transcripts.findOne({ code: code });
     }
 
@@ -322,9 +318,9 @@
                 }
                 else out += `> [Reply To] ${message.referencedMessage}\n`;
             }
-            out += `${message.author.nickname ?? message.author.username}#${message.author.discriminator} (${message.author.id}) (${message.id}) `;
-            out += `[${new Date(message.createdTimestamp).toISOString()}] `;
-            if (message.editedTimestamp) out += `[Edited: ${new Date(message.editedTimestamp).toISOString()}] `;
+            out += `${message.author.nickname ?? message.author.username}#${message.author.discriminator} (${message.author.id}) (${message.id})`;
+            out += ` [${new Date(message.createdTimestamp).toISOString()}]`;
+            if (message.editedTimestamp) out += ` [Edited: ${new Date(message.editedTimestamp).toISOString()}]`;
             out += "\n";
             if (message.content) out += `[Content]\n${message.content}\n\n`;
             if (message.embeds) {
@@ -380,7 +376,7 @@
         after?: string | null,
         amount?: string | null
     ) {
-        console.log("History create");
+        // console.log("History create");
         await this.histories.insertOne({
             type: type,
             guild: guild,
@@ -395,7 +391,7 @@
     }
 
     async read(guild: string, user: string, year: number) {
-        console.log("History read");
+        // console.log("History read");
         const entry = (await this.histories
             .find({
                 guild: guild,
@@ -410,7 +406,7 @@
     }
 
     async delete(guild: string) {
-        console.log("History delete");
+        // console.log("History delete");
         await this.histories.deleteMany({ guild: guild });
     }
 }
@@ -430,17 +426,17 @@
     }
 
     async read(hash: string) {
-        console.log("ScanCache read");
+        // console.log("ScanCache read");
         return await this.scanCache.findOne({ hash: hash });
     }
 
     async write(hash: string, data: boolean, tags?: string[]) {
-        console.log("ScanCache write");
+        // console.log("ScanCache write");
         await this.scanCache.insertOne({ hash: hash, data: data, tags: tags ?? [], addedAt: new Date() }, collectionOptions);
     }
 
     async cleanup() {
-        console.log("ScanCache cleanup");
+        // console.log("ScanCache cleanup");
         await this.scanCache.deleteMany({ addedAt: { $lt: new Date(Date.now() - (1000 * 60 * 60 * 24 * 31)) }, hash: { $not$text: "http"} });
     }
 }
@@ -453,12 +449,12 @@
     }
 
     async record(data: PerformanceDataSchema) {
-        console.log("PerformanceTest record");
+        // console.log("PerformanceTest record");
         data.timestamp = new Date();
         await this.performanceData.insertOne(data, collectionOptions);
     }
     async read() {
-        console.log("PerformanceTest read");
+        // console.log("PerformanceTest read");
         return await this.performanceData.find({}).toArray();
     }
 }
@@ -482,18 +478,18 @@
     }
 
     async create(guild: string, user: string, note: string | null) {
-        console.log("ModNotes create");
+        // console.log("ModNotes create");
         await this.modNotes.updateOne({ guild: guild, user: user }, { $set: { note: note } }, { upsert: true });
     }
 
     async read(guild: string, user: string) {
-        console.log("ModNotes read");
+        // console.log("ModNotes read");
         const entry = await this.modNotes.findOne({ guild: guild, user: user });
         return entry?.note ?? null;
     }
 
     async delete(guild: string) {
-        console.log("ModNotes delete");
+        // console.log("ModNotes delete");
         await this.modNotes.deleteMany({ guild: guild });
     }
 }
@@ -509,24 +505,24 @@
     }
 
     async updateUser(user: string, level: number) {
-        console.log("Premium updateUser");
+        // console.log("Premium updateUser");
         if(!(await this.userExists(user))) await this.createUser(user, level);
         await this.premium.updateOne({ user: user }, { $set: { level: level } }, { upsert: true });
     }
 
     async userExists(user: string): Promise<boolean> {
-        console.log("Premium userExists");
+        // console.log("Premium userExists");
         const entry = await this.premium.findOne({ user: user });
         return entry ? true : false;
     }
 
     async createUser(user: string, level: number) {
-        console.log("Premium createUser");
+        // console.log("Premium createUser");
         await this.premium.insertOne({ user: user, appliesTo: [], level: level }, collectionOptions);
     }
 
     async hasPremium(guild: string): Promise<[boolean, string, number, boolean] | null> {
-        console.log("Premium hasPremium");
+        // console.log("Premium hasPremium");
         // [Has premium, user giving premium, level, is mod: if given automatically]
         const cached = this.cache.get(guild);
         if (cached && cached[4].getTime() < Date.now()) return [cached[0], cached[1], cached[2], cached[3]];
@@ -566,14 +562,14 @@
     }
 
     async fetchUser(user: string): Promise<PremiumSchema | null> {
-        console.log("Premium fetchUser");
+        // console.log("Premium fetchUser");
         const entry = await this.premium.findOne({ user: user });
         if (!entry) return null;
         return entry;
     }
 
     async checkAllPremium(member?: GuildMember) {
-        console.log("Premium checkAllPremium");
+        // console.log("Premium checkAllPremium");
         const entries = await this.premium.find({}).toArray();
         if(member) {
             const entry = entries.find(e => e.user === member.id);
@@ -627,14 +623,14 @@
     }
 
     async addPremium(user: string, guild: string) {
-        console.log("Premium addPremium");
+        // console.log("Premium addPremium");
         const { level } = (await this.fetchUser(user))!;
         this.cache.set(guild, [true, user, level, false, new Date(Date.now() + this.cacheTimeout)]);
         return this.premium.updateOne({ user: user }, { $addToSet: { appliesTo: guild } }, { upsert: true });
     }
 
     removePremium(user: string, guild: string) {
-        console.log("Premium removePremium");
+        // console.log("Premium removePremium");
         this.cache.set(guild, [false, "", 0, false, new Date(Date.now() + this.cacheTimeout)]);
         return this.premium.updateOne({ user: user }, { $pull: { appliesTo: guild } });
     }
@@ -684,7 +680,7 @@
         clean: {
             channels: string[];
             allowed: {
-                user: string[];
+                users: string[];
                 roles: string[];
             }
         }
