This commit is contained in:
choelzl 2022-02-23 20:03:44 +01:00
parent 852a3a3c01
commit c6461ddda9
Signed by: sora
GPG Key ID: A362EA0491E2EEA0

View File

@ -1,5 +1,15 @@
(function() { (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){ function getNoTwitchEmotes(event, message){
var emotes = event.getTags().get('emotes'), var emotes = event.getTags().get('emotes'),
str = message, i; str = message, i;
@ -30,7 +40,7 @@
message = event.getMessage(); message = event.getMessage();
tags = event.getTags(); tags = event.getTags();
if(message.indexOf('!')!=0) 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) { $.bind('command', function(event) {