This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MAX_CACHE_SIZE = 50; | |
var messages = []; | |
function onMessageReceive(message) { | |
if (messages.length >= MAX_CACHE_SIZE) messages.shift(); | |
messages.push(message); | |
} | |
function onMessageDelete(message){ | |
var msg = getMessageById(message.ID); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onMessageSend(message){ | |
return message.replace(/%%([^%]*)%%/g, function(autismo){ | |
autismo = autismo.split('') | |
for(var i=0; i<autismo.length; i++){ | |
autismo[i] = i%2?autismo[i].toLowerCase():autismo[i].toUpperCase() | |
} | |
autismo.push(' :spongemock:') | |
return autismo.join('') | |
}) | |
.replace(/°°([^°]*)°°/g, function(autismo){ |