started Kick support
This commit is contained in:
+8
-4
@@ -6,12 +6,16 @@ function esc(s) {
|
||||
.replace(/"/g,'"').replace(/'/g,''')
|
||||
}
|
||||
|
||||
/* handle Twitch and YouTube emotes */
|
||||
/* handle Twitch, YouTube and Kick emotes */
|
||||
function handleEmotes(text) {
|
||||
var url = 'https://static-cdn.jtvnw.net/emoticons/v2/$id/default/dark/1.0'
|
||||
var twurl = 'https://static-cdn.jtvnw.net/emoticons/v2/$id/default/dark/1.0'
|
||||
var kickurl = 'https://files.kick.com/emotes/$id/fullsize'
|
||||
/* Handle Twitch emotes coming from backends */
|
||||
text = text.replace(/#EMOTE-[^\s]+#/g,
|
||||
a=>'<img src="' + url.replace('$id', a.split('-')[1].slice(0,-1)) + '">')
|
||||
text = text.replace(/#TWEMOTE-[^\s]+#/g,
|
||||
a=>'<img src="' + twurl.replace('$id', a.split('-')[1].slice(0,-1)) + '">')
|
||||
/* Handle Kick emotes coming from backends */
|
||||
text = text.replace(/#KKEMOTE-[^\s]+#/g,
|
||||
a=>'<img src="' + kickurl.replace('$id', a.split('-')[1].slice(0,-1)) + '">')
|
||||
/* Handle YouTube emotes */
|
||||
text = text.replace(/:[^\s]+:/g, a => {
|
||||
if(YT_EMOTES.indexOf(a) > -1) /* found in the database */
|
||||
|
||||
Reference in New Issue
Block a user