add trolling

This commit is contained in:
Lea 2023-11-08 20:32:05 +01:00
parent 753dc2e206
commit 842ad55d61
Signed by: Lea
GPG key ID: 1BAFFE8347019C42

View file

@ -273,6 +273,8 @@ client.on('message', async (message) => {
} catch(e) {
await message.reply('nuh uh');
}
} else {
await wordFilters(message);
}
return;
}
@ -539,6 +541,26 @@ client.on('message', async (message) => {
}
});
async function wordFilters(message: Message) {
try {
const RE_POKETUBE_VIDEO = /https?:\/\/(poketube.fun|poketube.sudovanilla.com)\/watch\?([^\s\/]+&)?v=(?<videoid>[^\s\/?&]{1,16})(&\S*)?/gi;
const results: string[] = [];
if (!message.content) return;
for (const result of message.content.matchAll(RE_POKETUBE_VIDEO)) {
var id = result.groups?.videoid;
if (id) results.push(`https://youtu.be/${id}`);
}
if (results.length) {
await message.reply(results.join('\n'));
}
} catch(e) {
console.error(e);
}
}
client.on('member/join', async (member) => {
const GAMER_WORDS = /nigg{er,a}|hitt?ler|trann(y|ie)|troon|faggot/i;
const CHILD_WORDS = /roblox|fran(ç|c)ais/i;