possumbot/modules/meow.js
2024-08-30 09:21:30 +00:00

49 lines
777 B
JavaScript

var meows = [
"mreow",
"miau",
"mewo",
"maow",
"mrow",
"mrao",
"meow",
"mew",
"nya",
];
var re = new RegExp("\\b(n+y+a+n?+|m+[re]*([yiaou]+[wu]+|w+))(ing|er|s)?\\b", "gi");
var emoticons = [
":3",
"^w^",
"=^w^=",
"-w-",
":333"
];
async function onMessage(client, event) {
var content = event.getContent();
if(content["m.new_content"] != null) return;
for(const meow of meows) {
if(content.body.toLowerCase().includes(re)) {
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
}
}