Skip to content

Commit 24d71bd

Browse files
committed
Merge branch 'master' of github.com:SebOuellette/LiveBot
Merge master
2 parents 4fd4923 + 93560cd commit 24d71bd

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

js/parseMessage.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ let parseSend = (text) => {
3131
return a;
3232
});
3333

34+
let customEmojiRegex = /^:([\d\w]+):|[^<]:([\d\w]+):/gm;
35+
text = text.replaceAll('::',': :').replaceAll(customEmojiRegex, (name) => {
36+
console.log(name);
37+
if (name[1] === ':')
38+
return name[0]+bot.emojis.cache.find(emoji => emoji.name == name.slice(2,-1)).toString();
39+
else
40+
return bot.emojis.cache.find(emoji => emoji.name == name.slice(1,-1)).toString();
41+
});
42+
3443
return text;
3544
};
3645

0 commit comments

Comments
 (0)