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