Added support for different instances

This commit is contained in:
MathMan05 2024-06-08 12:48:52 -05:00
parent e219ae7fc7
commit f6d33a7aa8
8 changed files with 96 additions and 30 deletions

View file

@ -36,7 +36,7 @@ class cmessage{
line2.classList.add("reply");
line.classList.add("startreply");
replyline.classList.add("replyflex")
fetch("https://old.server.spacebar.chat/api/v9/channels/"+this.message_reference.channel_id+"/messages?limit=1&around="+this.message_reference.message_id,{headers:{Authorization:token}}).then(responce=>responce.json()).then(responce=>{
fetch(info.api.toString()+"/v9/channels/"+this.message_reference.channel_id+"/messages?limit=1&around="+this.message_reference.message_id,{headers:{Authorization:token}}).then(responce=>responce.json()).then(responce=>{
const author=new user(responce[0].author);
reply.appendChild(markdown(responce[0].content));
@ -107,7 +107,7 @@ class cmessage{
const attatch = document.createElement("tr")
for(const thing of this.attachments){
const array=thing.url.split("/");array.shift();array.shift();array.shift();
const src="https://cdn.old.server.spacebar.chat/"+array.join("/");
const src=info.cdn.toString()+array.join("/");
if(thing.content_type.startsWith('image/')){
const img=document.createElement("img");
img.classList.add("messageimg")