From c6461ddda986bed3245b0c285d0b6618eefedd6c Mon Sep 17 00:00:00 2001 From: choelzl Date: Wed, 23 Feb 2022 20:03:44 +0100 Subject: [PATCH] WIP --- twitch/customEmoteWall.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/twitch/customEmoteWall.js b/twitch/customEmoteWall.js index 7db8ae6..5741389 100644 --- a/twitch/customEmoteWall.js +++ b/twitch/customEmoteWall.js @@ -1,5 +1,15 @@ (function() { + function getWordAt(str, pos) { + str = String(str); + pos = pos >>> 0; + var left = str.slice(0, pos + 2).search(/\S+$/), + right = str.slice(pos).search(/\s/); + if (right < 0) + return str.slice(left); + return str.slice(left, right + pos); + } + function getNoTwitchEmotes(event, message){ var emotes = event.getTags().get('emotes'), str = message, i; @@ -30,7 +40,7 @@ message = event.getMessage(); tags = event.getTags(); if(message.indexOf('!')!=0) - sendData('bounce',event.getTags().get('emotes'), getNoTwitchEmotes(event,message)) + sendData('bounce',event.getTags().get('emotes'), getNoTwitchEmotes(event,message).split(/\s+/)) }) $.bind('command', function(event) {