Compare commits

...

2 commits

Author SHA1 Message Date
Lea 9bceeb6060
mlem 2023-11-08 21:21:27 +01:00
Lea 9986d8c410
more funny 2023-11-08 20:45:59 +01:00

View file

@ -542,13 +542,14 @@ client.on('message', async (message) => {
});
async function wordFilters(message: Message) {
if (!message.content) return;
const content = message.content.replace(/\u200b/g, "");
try {
const RE_POKETUBE_VIDEO = /https?:\/\/(poketube.fun|poketube.sudovanilla.com)\/watch\?([^\s\/]+&)?v=(?<videoid>[^\s\/?&]{1,16})(&\S*)?/gi;
const RE_YOUTUBE_PROXY = /https?:\/\/(\w+\.)?(poketube\.fun|poketube\.sudovanilla\.com|piped\.video)\/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)) {
for (const result of content.matchAll(RE_YOUTUBE_PROXY)) {
var id = result.groups?.videoid;
if (id) results.push(`https://youtu.be/${id}`);
}
@ -559,6 +560,14 @@ async function wordFilters(message: Message) {
} catch(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) => {