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
     }
