add trolling
This commit is contained in:
parent
753dc2e206
commit
842ad55d61
22
src/index.ts
22
src/index.ts
|
@ -273,6 +273,8 @@ client.on('message', async (message) => {
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
await message.reply('nuh uh');
|
await message.reply('nuh uh');
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
await wordFilters(message);
|
||||||
}
|
}
|
||||||
return;
|
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) => {
|
client.on('member/join', async (member) => {
|
||||||
const GAMER_WORDS = /nigg{er,a}|hitt?ler|trann(y|ie)|troon|faggot/i;
|
const GAMER_WORDS = /nigg{er,a}|hitt?ler|trann(y|ie)|troon|faggot/i;
|
||||||
const CHILD_WORDS = /roblox|fran(ç|c)ais/i;
|
const CHILD_WORDS = /roblox|fran(ç|c)ais/i;
|
||||||
|
|
Loading…
Reference in a new issue