2023-03-24 19:36:11 +00:00
|
|
|
#!/bin/sh
|
|
|
|
//bin/true; exec deno run -A "$0" "$@"
|
2023-03-24 21:08:36 +00:00
|
|
|
import {
|
|
|
|
antiDuplicationPolicy,
|
2023-03-28 22:22:30 +00:00
|
|
|
filterPolicy,
|
2023-03-24 21:08:36 +00:00
|
|
|
hellthreadPolicy,
|
2023-03-26 21:40:35 +00:00
|
|
|
keywordPolicy,
|
2023-03-24 21:08:36 +00:00
|
|
|
noopPolicy,
|
|
|
|
pipeline,
|
2023-03-26 20:37:24 +00:00
|
|
|
pubkeyBanPolicy,
|
2023-03-24 21:08:36 +00:00
|
|
|
rateLimitPolicy,
|
|
|
|
readStdin,
|
2023-03-26 22:02:59 +00:00
|
|
|
regexPolicy,
|
2023-03-24 21:08:36 +00:00
|
|
|
writeStdout,
|
|
|
|
} from './mod.ts';
|
2023-03-24 19:36:11 +00:00
|
|
|
|
2023-03-25 16:38:27 +00:00
|
|
|
for await (const msg of readStdin()) {
|
|
|
|
const result = await pipeline(msg, [
|
|
|
|
noopPolicy,
|
2023-03-28 22:22:30 +00:00
|
|
|
[filterPolicy, { kinds: [0, 1, 3, 5, 7, 1984, 9734, 9735, 10002] }],
|
2023-03-26 21:40:35 +00:00
|
|
|
[keywordPolicy, ['https://t.me/']],
|
2023-03-26 22:02:59 +00:00
|
|
|
[regexPolicy, /(🟠|🔥|😳)ChtaGPT/i],
|
2023-03-28 21:16:47 +00:00
|
|
|
[pubkeyBanPolicy, ['e810fafa1e89cdf80cced8e013938e87e21b699b24c8570537be92aec4b12c18']],
|
|
|
|
[hellthreadPolicy, { limit: 100 }],
|
|
|
|
[rateLimitPolicy, { whitelist: ['127.0.0.1'] }],
|
|
|
|
[antiDuplicationPolicy, { ttl: 60000, minLength: 50 }],
|
2023-03-25 16:38:27 +00:00
|
|
|
]);
|
2023-03-24 21:08:36 +00:00
|
|
|
|
2023-03-25 16:38:27 +00:00
|
|
|
writeStdout(result);
|
|
|
|
}
|