diff --git a/src/commands/mod/purge.ts b/src/commands/mod/purge.ts
index 37b703e..8644e26 100644
--- a/src/commands/mod/purge.ts
+++ b/src/commands/mod/purge.ts
@@ -29,7 +29,7 @@
     if (!interaction.guild) return;
     const user = (interaction.options.getMember("user") as GuildMember | null);
     const channel = interaction.channel as GuildChannel;
-    if (channel.isTextBased()) {
+    if (!channel.isTextBased()) {
         return await interaction.reply({
             embeds: [
                 new EmojiEmbed()
diff --git a/src/commands/nucleus/_meta.ts b/src/commands/nucleus/_meta.ts
index 521b338..bd7fd14 100644
--- a/src/commands/nucleus/_meta.ts
+++ b/src/commands/nucleus/_meta.ts
@@ -3,8 +3,6 @@
 const name = "nucleus";
 const description = "Commands relating to Nucleus itself";
 
-const subcommand = await command(name, description, `nucleus`)
+const subcommand = await command(name, description, `nucleus`, undefined, undefined, undefined, undefined, true);
 
-const allowedInDMs = true;
-
-export { name, description, subcommand as command, allowedInDMs };
+export { name, description, subcommand as command };
diff --git a/src/utils/commandRegistration/register.ts b/src/utils/commandRegistration/register.ts
index d88a13a..33c88b0 100644
--- a/src/utils/commandRegistration/register.ts
+++ b/src/utils/commandRegistration/register.ts
@@ -181,7 +181,7 @@
 }
 
 async function execute(check: Function | undefined, callback: Function | undefined, data: CommandInteraction) {
-    console.log(client.commands["contextCommands/user/User info"])
+    // console.log(client.commands["contextCommands/user/User info"])
     if (!callback) return;
     if (check) {
         let result;
diff --git a/src/utils/database.ts b/src/utils/database.ts
index b7971c3..88efc70 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -3,6 +3,7 @@
 import { Collection, MongoClient } from "mongodb";
 import config from "../config/main.js";
 import client from "../utils/client.js";
+import * as crypto from "crypto";
 
 const mongoClient = new MongoClient(config.mongoUrl);
 await mongoClient.connect();
@@ -133,7 +134,8 @@
     topRole: {
         color: number;
         badgeURL?: string;
-    }
+    };
+    bot: boolean;
 }
 
 interface TranscriptAttachment {
@@ -178,7 +180,7 @@
     async create(transcript: Omit<TranscriptSchema, "code">) {
         let code;
         do {
-            code = Math.random().toString(36).substring(2, 16) + Math.random().toString(36).substring(2, 16);
+            code = crypto.randomBytes(64).toString("base64").replace(/=/g, "").replace(/\//g, "_").replace(/\+/g, "-");
         } while (await this.transcripts.findOne({ code: code }));
 
         const doc = await this.transcripts.insertOne(Object.assign(transcript, { code: code }));
@@ -200,7 +202,9 @@
                 id: member!.user.id,
                 topRole: {
                     color: member!.roles.highest.color
-                }
+                },
+                iconURL: member!.user.displayAvatarURL({ forceStatic: true}),
+                bot: member!.user.bot
             },
             guild: interaction.guild!.id,
             channel: interaction.channel!.id,
@@ -212,9 +216,12 @@
                 id: interaction.user.id,
                 topRole: {
                     color: interactionMember?.roles.highest.color ?? 0x000000
-                }
+                },
+                iconURL: interaction.user.displayAvatarURL({ forceStatic: true}),
+                bot: interaction.user.bot
             }
         }
+        if(member.nickname) newOut.for.nickname = member.nickname;
         if(interactionMember?.roles.icon) newOut.createdBy.topRole.badgeURL = interactionMember.roles.icon.iconURL()!;
         messages.reverse().forEach((message) => {
             const msg: TranscriptMessage = {
@@ -225,10 +232,13 @@
                     id: message.author.id,
                     topRole: {
                         color: message.member!.roles.highest.color
-                    }
+                    },
+                    iconURL: member!.user.displayAvatarURL({ forceStatic: true}),
+                    bot: message.author.bot
                 },
                 createdTimestamp: message.createdTimestamp
             };
+            if(message.member?.nickname) msg.author.nickname = message.member.nickname;
             if (message.member!.roles.icon) msg.author.topRole.badgeURL = message.member!.roles.icon.iconURL()!;
             if (message.content) msg.content = message.content;
             if (message.embeds.length > 0) msg.embeds = message.embeds.map(embed => {
@@ -314,6 +324,7 @@
                     out += `[Attachment] ${attachment.filename} (${attachment.size} bytes) ${attachment.url}\n`;
                 }
             }
+            out += "\n\n"
         }
         return out
     }
