-
-
Save fl4ke/3a6b8fc067526538efa4d4e4242aadb8 to your computer and use it in GitHub Desktop.
Memescript for Cordless
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){ | |
return autismo.replace(/[A-Za-z]/g, function(c){ | |
return ":regional_indicator_"+c.toLowerCase()+":" | |
}) | |
.replace(/[0-9]/g, function(n){ | |
var numWord = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'] | |
return ":"+numWord[n]+":" | |
}) | |
}) | |
.split(/(:regional_indicator_.:)/g) | |
.join('\u200b') | |
.replace(/§§([^§]*)§§/g, function(autismo){ | |
autismo = autismo.split(' ') | |
for(var i=0; i<autismo.length; i++){ | |
autismo[i] = autismo[i]+":clap:" | |
} | |
return autismo.join('') | |
}) | |
.replace(/!!([^!]*)!!/g, function(autismo){ | |
autismo = autismo.split(' ') | |
for(var i=0; i<autismo.length; i++){ | |
autismo[i] = autismo[i]+":harj7:" | |
} | |
return autismo.join('') | |
}) | |
.replace('nibba', 'ni:b::b:a') | |
.replace(/°°|%%|§§|!!/g, '') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment