2024-08-21 17:00:40 +02:00
|
|
|
var meows = [
|
|
|
|
"mreow",
|
|
|
|
"miau",
|
|
|
|
"mewo",
|
|
|
|
"maow",
|
|
|
|
"mrow",
|
|
|
|
"mrao",
|
|
|
|
"meow",
|
|
|
|
"mew",
|
|
|
|
"nya",
|
|
|
|
];
|
|
|
|
|
2024-08-30 11:22:55 +02:00
|
|
|
var re = new RegExp("\\b(n+y+a+n*?|m+[re]*([yiaou]+[wu]+|w+))(ing|er|s)?\\b", "gi");
|
2024-08-30 11:21:07 +02:00
|
|
|
|
2024-08-21 17:00:40 +02:00
|
|
|
var emoticons = [
|
|
|
|
":3",
|
|
|
|
"^w^",
|
|
|
|
"=^w^=",
|
|
|
|
"-w-",
|
|
|
|
":333"
|
|
|
|
];
|
|
|
|
|
|
|
|
async function onMessage(client, event) {
|
2024-08-25 20:37:24 +02:00
|
|
|
var content = event.getContent();
|
|
|
|
|
|
|
|
if(content["m.new_content"] != null) return;
|
2024-08-21 17:00:40 +02:00
|
|
|
|
|
|
|
for(const meow of meows) {
|
2024-08-30 11:24:35 +02:00
|
|
|
if(re.test(content.body.toLowerCase())) {
|
2024-08-21 17:00:40 +02:00
|
|
|
var reply = meows.random();
|
|
|
|
reply += "!".repeat(Math.random()*5)
|
|
|
|
|
|
|
|
if(Math.random() > 0.5) {
|
|
|
|
reply += " " + emoticons.random();
|
|
|
|
}
|
|
|
|
|
|
|
|
client.reply(event, reply);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "meow",
|
|
|
|
desc: ":33",
|
|
|
|
hooks: {
|
|
|
|
message: onMessage
|
|
|
|
}
|
|
|
|
}
|