more funny

This commit is contained in:
Lea 2023-11-08 20:45:59 +01:00
parent 842ad55d61
commit 9986d8c410
Signed by: Lea
GPG key ID: 1BAFFE8347019C42

View file

@ -542,13 +542,14 @@ client.on('message', async (message) => {
}); });
async function wordFilters(message: Message) { async function wordFilters(message: Message) {
if (!message.content) return;
const content = message.content.replace(/\u200b/g, "");
try { try {
const RE_POKETUBE_VIDEO = /https?:\/\/(poketube.fun|poketube.sudovanilla.com)\/watch\?([^\s\/]+&)?v=(?<videoid>[^\s\/?&]{1,16})(&\S*)?/gi; const RE_POKETUBE_VIDEO = /https?:\/\/(poketube.fun|poketube.sudovanilla.com)\/watch\?([^\s\/]+&)?v=(?<videoid>[^\s\/?&]{1,16})(&\S*)?/gi;
const results: string[] = []; const results: string[] = [];
if (!message.content) return; for (const result of content.matchAll(RE_POKETUBE_VIDEO)) {
for (const result of message.content.matchAll(RE_POKETUBE_VIDEO)) {
var id = result.groups?.videoid; var id = result.groups?.videoid;
if (id) results.push(`https://youtu.be/${id}`); if (id) results.push(`https://youtu.be/${id}`);
} }
@ -559,6 +560,14 @@ async function wordFilters(message: Message) {
} catch(e) { } catch(e) {
console.error(e); console.error(e);
} }
try {
if (message.author_id == "01FD0D2ED95QTQX442AZRWWMQK" && /(^|\s|\W)(pt|poketube|poke|pokesearch)($|\s|\W)/i.test(content)) {
await message.react('01HER6VW6PX7H5BD6J6J6ZS3VJ');
}
} catch(e) {
console.error(e);
}
} }
client.on('member/join', async (member) => { client.on('member/join', async (member) => {