diff --git "a/pages/nucleus/transcript/\133code\135/human.js" "b/pages/nucleus/transcript/\133code\135/human.js"
index d84a78f..18273ef 100644
--- "a/pages/nucleus/transcript/\133code\135/human.js"
+++ "b/pages/nucleus/transcript/\133code\135/human.js"
@@ -13,7 +13,7 @@
     }
     let code;
     try {
-        code = (await Axios.get(`http://localhost:10000/transcript/${ctx.params.code}`))
+        code = (await Axios.get(`http://${process.env.NUCLEUS_CALLBACK}/transcript/${ctx.params.code}`))
     } catch (e) {
         return {
             redirect: {
@@ -24,7 +24,7 @@
     }
     return {
         redirect: {
-            destination: `http://api.coded.codes/nucleus/transcript/${ctx.params.code}/human`,
+            destination: `http://${process.env.NUCLEUS_CALLBACK}/transcript/${ctx.params.code}/human`,
             permanent: true
         }
     }
diff --git "a/pages/nucleus/transcript/\133code\135/index.js" "b/pages/nucleus/transcript/\133code\135/index.js"
index 4b2389f..c5c4876 100644
--- "a/pages/nucleus/transcript/\133code\135/index.js"
+++ "b/pages/nucleus/transcript/\133code\135/index.js"
@@ -1,6 +1,96 @@
 import Axios from 'axios';
 import React from 'react';
 import Message from '../../../../Components/Transcripts/Message';
+import _ from 'lodash';
+
+const emojiRegex = /(<a?:.+:\D+>)/g;
+const userRegex = /(<@!?\d+>)/g;
+const channelRegex = /(<#\d+>)/g;
+
+async function parseText(text) {
+    const dict = {
+        "emojis": {},
+        "users": {},
+        "channels": {}
+    }
+    const emojis = text.match(emojiRegex);
+    if (emojis) {
+        for (let i = 0; i < emojis.length; i++) {
+            const emoji = emojis[i];
+            const emojiID = emoji.replaceAll(/\D/g, '');
+            const emojiURL = `https://cdn.discord.com/emojis/${emojiID}`;
+            dict["emojis"][emoji] = emojiURL;
+        }
+    }
+    const users = text.match(userRegex);
+    if (users) {
+        for (let i = 0; i < users.length; i++) {
+            const user = users[i];
+            const userID = user.replaceAll(/\D/g, '');
+            const username = (await Axios.get(`http://${process.env.NUCLEUS_CALLBACK}/users/${userID}`)).data;
+            dict["users"][user.replaceAll(/<@|>/g, '')] = username;
+        }
+    }
+    const channels = text.match(channelRegex);
+    if (channels) {
+        for (let i = 0; i < channels.length; i++) {
+            const channel = channels[i];
+            const channelID = channel.replaceAll(/\D/g, '');
+            const channelName = (await Axios.get(`http://${process.env.NUCLEUS_CALLBACK}/channels/${channelID}`)).data;
+            dict["channels"][channel] = channelName;
+        }
+    }
+    // console.log("parseText", dict)
+    return dict
+}
+
+async function parse(json) {
+    let dict = {
+        "emojis": {},
+        "users": {},
+        "channels": {}
+    }
+
+    await _.forEach(json, async (message, index) => {
+        let thisMessage = {}
+        if(message.content) {
+            let parsed = await parseText(message.content)
+            // console.log(parsed)
+            _.assign(thisMessage, parsed)
+        }
+        if(message.embeds) {
+            _.forEach(message.embeds, async (embed, _index) => {
+                // console.log(embed)
+                if(embed.description) {
+                    let parsed = await parseText(embed.description)
+                    _.assign(thisMessage, parsed)
+                }
+                if(embed.title) {
+                    let parsed = await parseText(embed.title)
+                    _.assign(thisMessage, parsed)
+                }
+                if(embed.fields) {
+                    _.forEach(embed.fields, async (field, _index) => {
+                        if(field.name) {
+                            let parsed = await parseText(field.name)
+                            _.assign(thisMessage, parsed)
+                        }
+                        if(field.value) {
+                            let parsed = await parseText(field.value)
+                            _.assign(thisMessage, parsed)
+                        }
+                    })
+                }
+            })
+        }
+        // console.log(thisMessage)
+        _.assign(dict, thisMessage)
+        // console.log(index, dict)
+    })
+
+    // console.log("dict", dict)
+    return dict;
+}
 
 function Index(props) {
     return <div style={{overflowY: "scroll", overflowX: "hidden"}}>
@@ -14,7 +104,7 @@
             paddingLeft: "25px",
             color: "white",
             fontSize: "1.5em",
-        }}>Transcript for: {props.data.for.username}#{props.data.for.discriminator} | In {<a href={`https://discord.com/channels/${props.data.guild}/${props.data.channel}`}>ChannelName</a>} | Type: {props.data.type}</div>
+        }}>Transcript for: {props.data.for.username}#{props.data.for.discriminator} | In #{<a href={`https://discord.com/channels/${props.data.guild}/${props.data.channel}`}>{props.channelName}</a>} | Type: {props.data.type}</div>
         <div style={{
             width: "100vw",
             backgroundColor: "var(--theme-ui-colors-background)", //Can we change this to be not black please. it's too contrast heavy
@@ -42,20 +132,32 @@
             }
         }
     }
-    let code;
-    try {
-        code = (await Axios.get(`http://localhost:10000/transcript/${ctx.params.code}`))
-    } catch (e) {
-        return {
-            redirect: {
-                destination: '/nucleus/transcript/invalid',
-                permanent: true
-            }
-        }
-    }
     return {
-        props: {
-            data: code.data
+        redirect: {
+            destination: `/nucleus/transcript/${ctx.params.code}/human`,
+            permanent: true
         }
     }
+    // let code;
+    // try {
+    //     code = (await Axios.get(`http://${process.env.NUCLEUS_CALLBACK}/transcript/${ctx.params.code}`))
+    // } catch (e) {
+    //     return {
+    //         redirect: {
+    //             destination: '/nucleus/transcript/invalid',
+    //             permanent: true
+    //         }
+    //     }
+    // }
+    // const linkedData = await parse(code.data.messages)
+
+    // const channelName = (await Axios.get(`http://${process.env.NUCLEUS_CALLBACK}/channels/${code.data.channel}`)).data;
+
+    // return {
+    //     props: {
+    //         data: code.data,
+    //         linkedData,
+    //         channelName
+    //     }
+    // }
 }
\ No newline at end of file
diff --git "a/pages/nucleus/transcript/\133code\135/raw.js" "b/pages/nucleus/transcript/\133code\135/raw.js"
index 8c5436e..da6ac40 100644
--- "a/pages/nucleus/transcript/\133code\135/raw.js"
+++ "b/pages/nucleus/transcript/\133code\135/raw.js"
@@ -14,7 +14,7 @@
     }
     let code;
     try {
-        code = (await Axios.get(`http://localhost:10000/transcript/${ctx.params.code}`))
+        code = (await Axios.get(`http://${process.env.NUCLEUS_CALLBACK}/transcript/${ctx.params.code}`))
     } catch (e) {
         return {
             redirect: {
@@ -25,7 +25,7 @@
     }
     return {
         redirect: {
-            destination: `http://localhost:10000/transcript/${ctx.params.code}`,
+            destination: `http://${process.env.NUCLEUS_CALLBACK}/transcript/${ctx.params.code}`,
             permanent: true
         }
     }
