regex meow

This commit is contained in:
Ashley 2024-08-30 09:21:07 +00:00
parent c6bdd23bf4
commit e3a20067e3

View file

@ -10,6 +10,8 @@ var meows = [
"nya",
];
var re = new RegExp("\b(n+y+a+n?+|m+[re]*([yiaou]+[wu]+|w+))(ing|er|s)?\b", "gi");
var emoticons = [
":3",
"^w^",
@ -24,7 +26,7 @@ async function onMessage(client, event) {
if(content["m.new_content"] != null) return;
for(const meow of meows) {
if(content.body.toLowerCase().includes(meow)) {
if(content.body.toLowerCase().includes(re)) {
var reply = meows.random();
reply += "!".repeat(Math.random()*5)