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

@@ -121,7 +121,7 @@ class localuser{
if(thing.properties.icon!=null){
const img=document.createElement("img");
img.classList.add("pfp","servericon")
img.src="https://cdn.old.server.spacebar.chat/icons/"+thing.properties.id+"/"+thing.properties.icon+".png";
img.src=info.cdn.toString()+"icons/"+thing.properties.id+"/"+thing.properties.icon+".png";
divy.appendChild(img)
img.all=thing;
img.onclick=function(){
@@ -193,7 +193,7 @@ class localuser{
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function () {
fetch("https://old.server.spacebar.chat/api/v9/users/@me",{
fetch(info.api.toString()+"/v9/users/@me",{
method:"PATCH",
headers:{
"Content-type": "application/json; charset=UTF-8",
@@ -208,7 +208,7 @@ class localuser{
}
updatepronouns(pronouns){
fetch("https://old.server.spacebar.chat/api/v9/users/@me/profile",{
fetch(info.api.toString()+"/v9/users/@me/profile",{
method:"PATCH",
headers:{
"Content-type": "application/json; charset=UTF-8",
@@ -220,7 +220,7 @@ class localuser{
});
}
updatebio(bio){
fetch("https://old.server.spacebar.chat/api/v9/users/@me/profile",{
fetch(info.api.toString()+"/v9/users/@me/profile",{
method:"PATCH",
headers:{
"Content-type": "application/json; charset=UTF-8",