WIP
This commit is contained in:
parent
852a3a3c01
commit
c6461ddda9
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user