Per-Channel Emotes Implemented.

This commit is contained in:
rainbow napkin 2024-12-21 11:01:00 -05:00
parent 163cecf9f0
commit c3d016e1af
14 changed files with 483 additions and 20 deletions

View file

@ -561,6 +561,54 @@ class canopyAjaxUtils{
utils.ux.displayResponseError(await response.json());
}
}
async getChanEmotes(chanName){
var response = await fetch(`/api/channel/emote?chanName=${chanName}`,{
method: "GET",
headers: {
"Content-Type": "application/json"
}
});
if(response.status == 200){
return await response.json();
}else{
utils.ux.displayResponseError(await response.json());
}
}
async addChanEmote(chanName, emoteName, link){
var response = await fetch('/api/channel/emote',{
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({chanName, emoteName, link})
});
if(response.status == 200){
return await response.json();
}else{
utils.ux.displayResponseError(await response.json());
}
}
async deleteChanEmote(chanName, emoteName){
var response = await fetch('/api/channel/emote',{
method: "DELETE",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({chanName, emoteName})
});
if(response.status == 200){
return await response.json();
}else{
utils.ux.displayResponseError(await response.json());
}
}
}
const utils = new canopyUtils()