Updated commandPreprocessor to mark all emotes instead of just site-wide ones.

This commit is contained in:
rainbow napkin 2024-12-21 11:09:08 -05:00
parent c3d016e1af
commit 6a10bf3dea

View file

@ -64,7 +64,7 @@ class commandPreprocessor{
//Inject emote links into the message //Inject emote links into the message
this.message = this.message.replaceAll(`[${emote.name}]`, emote.link); this.message = this.message.replaceAll(`[${emote.name}]`, emote.link);
}); });
}) });
} }
processLinks(){ processLinks(){
@ -108,14 +108,17 @@ class commandPreprocessor{
//Create an empty variable to hold the found emote //Create an empty variable to hold the found emote
var foundEmote = null; var foundEmote = null;
//For every site-wide emote //For each list of emotes
this.emotes.site.forEach((emote) => { Object.keys(this.emotes).forEach((key) => {
//For each emote in the current list
this.emotes[key].forEach((emote) => {
//if we found a match //if we found a match
if(emote.link == link){ if(emote.link == link){
//return the match //return the match
foundEmote = emote; foundEmote = emote;
} }
}); });
});
return foundEmote; return foundEmote;
} }