Skip to content

Commit

Permalink
Merge branch 'master' of github.com:SebOuellette/LiveBot
Browse files Browse the repository at this point in the history
Merge master
  • Loading branch information
SebOuellette committed Dec 21, 2022
2 parents 4fd4923 + 93560cd commit 24d71bd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions js/parseMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ let parseSend = (text) => {
return a;
});

let customEmojiRegex = /^:([\d\w]+):|[^<]:([\d\w]+):/gm;
text = text.replaceAll('::',': :').replaceAll(customEmojiRegex, (name) => {
console.log(name);
if (name[1] === ':')
return name[0]+bot.emojis.cache.find(emoji => emoji.name == name.slice(2,-1)).toString();
else
return bot.emojis.cache.find(emoji => emoji.name == name.slice(1,-1)).toString();
});

return text;
};

Expand Down

0 comments on commit 24d71bd

Please sign in to comment.