regex meow
This commit is contained in:
parent
c6bdd23bf4
commit
e3a20067e3
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue