import { NPolicy, NostrEvent, NostrRelayOK } from '@nostrify/nostrify'; import { AntiDuplicationPolicy, HashtagPolicy, PubkeyBanPolicy, KeywordPolicy, PipePolicy } from '@nostrify/nostrify/policies'; const kv = await Deno.openKv(); export default class AppPolicy implements NPolicy { async call(event: NostrEvent): Promise { const policy = new PipePolicy([ new KeywordPolicy([ 'NSFW sexual content', ':nsfw:', 'nsfw 18+ Sexual', 'Get SCORE Cash', ':role_nsfw:']), /* Domain Keyword Bans */ new KeywordPolicy([ 'bae.st/media', 'scrolller.com/', 'media.shota.house/', '1img.99img.biz/', 'assets.bonito.cafe/', 'redgifs.com/watch', 'homealonemilfs.com/', 'karinahart.com/', 'oldhornymilfs.com/', 'mommystoytime.com/', 'getscorecash.com/', 'yourmomlovesanal.com/', 'milftugs.com/', 'creampieforgranny.com/', 'ibonedyourmom.com/', 'silversluts.com/', 'naughtymag.com/' ]), /* Porn/Sex Hashtags */ new HashtagPolicy([ 'adult', /* May give false positives? */ 'ass', 'assworship', 'boobs', 'boobies', 'blowjob', 'butt', 'cock', 'couplefucking', 'dick', 'dickpic', 'explosionloli', 'femboi', 'femboy', 'fetish', 'fuck', 'freeporn', 'girls', 'loli', 'milf', 'nude', 'nudity', 'pantsu', 'pussy', 'porn', 'porno', 'porntube', 'pornvideo', 'pissing', 'sex', 'sexpervertsyndicate', 'sexporn', 'sexy', 'slut', 'teen', 'threesome', 'tits', 'teenporn', 'teens', 'transnsfw', 'lewd', 'shota', 'sex_from_behind', 'sexfrombehind', 'bigtits', 'nsfw', 'xxx', '🔞']), new PubkeyBanPolicy([ '0f7512e327a8f92d76d3f1882b1f7504eb18f01d919c6b243108ea32f4e9cb71', '49c323f9d54aa1f2a120aa33a3ff8a8636b7b2c3473f2c3782f4acf768de4401', 'c3b4ad337ff8859cca9638b370cef2cb30782c185c16d83b7f983a7a18cf425f', '8eea02e8912085962a930b28beed2683a988614de9a339750ae0b3061e2c6db1', '53487c0a7f24a0c7bdc8eda247f445238be65e0f392d62ec570353835c09da54', '044536c57cdcbe174ce23f0154956c95d461931a151a761156b7345ef8c80e46', '3121ef9543850699ca74b7cf74cc953cb24720d1842dbb873f464576a400d46c', '63ddc28c5d48e4c2905432fde55c7981628fbe77060a9e47a9e0b6806081b9d3', 'b928b3da189e3f56af889122e50cc4476aeede14838fe13d796c0f05f2e4edd6', 'a6faa3d0bf8e3695f247d4dd0ad44f68890c8b0e7ea2997368b8f39f77935564', '9f087435e0e1e35e4d8b7008b28fb718e6ddc9df1e71c3a9f76b72018125dad5', 'baa2a1303cf013ad5bebbea306d9705f239f100a915f58c14ef5ce1afb720f7f', 'c70dc607cd65443ce2bc9c19832be64f3a49d015dbe1b90b52e5e73d2973249d', '3614633429258eb75592f6acd52baeecf1e95cc09e63a5ece4a28efe4ee8380a', '0dee4ad657fca0fd390553f6c68d108042a0923f7e760fb60b86f0e86f0f478e', 'aa0beec08012a3c0310c72607aa785979dad373cda06e7cac32eb34adc3973ab', '1ad25918d203920e3ad3d9af003d2072067fd572bcd723bef43819eb861d07f9', 'b9cfef992b4bc95a6fbf01942bd489336dea5890314f9aab408685538083aa48', '0d655124cc6a24382b4e351b72f1906012c39bbecb8e56334f99bb341f137c0d', '61af4200e31501dd5e5335507772ec48948a67c6245f7ba47d1e3e3044dd4d5e', 'a94264ee9eee60a516647bdbf4cde96c870e3a2c50ea0f6de1d463b5e1ef96dd', 'ab248ec288bfb4af685ea91d9836af63317039add93c6687f379c0e802f8a358', '6b929de3cea4cd247b06c462de75b8d9da1ad4f45344a02f92c3ed85ca099746', '8fc01b196c80341451e12bc561d9e394ebcaec5457917c36181c8d6a4a048a2e', '3c5684d95c5097e5880e4c18dd3bb16e9a5157d5644feab99c63c91f9c54aa7b', '06e3db0fc4be1c03ac9fe592b24b8c76fa2353ac63a5318c2c473a6afba41505', 'b0fed405b15d855a6a90d172c95bc8ce4bd1d904145707f7361df1e1f23eeece', '9280f242d869d4e6394cd3ce8f9408e926032dce4c2b415d6d681d116d1c5d97', 'e1bdfdc90828982d9e0a8453bd34f250ad5c497af4f244e5cb384987ebe15e10', 'a21b956fb5ca768b3ffffa25c360a886ac5455276ca4665cf5abd52121a5b387', '4f9180bbbc3b8acec745747ff88565c7b637819a71743dc5f9a3cb5ab7346923', '6475c78f901e33ba7a951f06e2bf8f4eea311baf09c0620c6e1bf9719086286c', '487c92cba06244b35294be302f6188d12b8506343a74d9923f2fc7d95053ebcf', '377415eab7a3ccaa0ad128901adb181c807b36ad120619a52a7105609535fdb4', '5fbc69d81c94c0fee87bf0a93b0d8d6d0d9764dede4f2e5481d528d07fefb1f7', '040800fbf037446914696f6bd33be1dcb34dee61f793cf709f00d161e21fd81c', '7bb277bade338032c54ae1080011376c9fa0c7581c708a6f219f6f0414138aa6', '4539c312f37283d795affc0622d32f1ce8feac3c87e2651b5da974c0d0c069b1', '642317135fd4c4205323b9dea8af3270657e62d51dc31a657c0ec8aab31c6288', 'f03df3d4134230420cdf7acbb35f96a2542424246ab052ba24c6fec6a4d4f676', '3493b0c2376fe2a91dc804985ffd681f50210611597a2003f724c6744ce7120f', '6d30bbc96c99027f6bffe8151700f650f5c0be0cba2d2ac814dcccaf5cb99d46', '070df0ac4b1f46bb7450ec04508ef30853f378c6797201ea0ba21930a017704e']), /* Non-English - RSS Spam */ new PubkeyBanPolicy([ 'd8bb8acc4ba66f6f03b61e0cbab3a4ffe7753d9defc3b41087bd93ef919a6849', '85035261ecddaf490e3fff9b9dc63cde7a9fb3243ba6bd1c4d89b372a457b1c1' ]), /* Non-English - Spam */ new PubkeyBanPolicy([ '00000006db73c124c60c17a47bcd5f4212f790df6f9b14521d330ba697f3fc38', 'a3c13ef4c9eccfde01bd9326a2ab08b2ad7dc57f3b77db77723f8e2ad7ba24d6', /*Riverspeed, JP Nostr Post Tracking*/ '77911886971fe579fe3e4f90d9dc7e91fcd74850dc2853681fff17654b218091' ]), /* Non-English - High Frequency Keys */ new PubkeyBanPolicy([ 'c81c7999f7276387317878e59d7c321093a433977ee6811ca76dc3a9738e1869' /*rain8128.github.io Follows Thousands of Keys.*/ ]), /* Crypto - Spam */ new PubkeyBanPolicy([ '1ae011cb34999af15602a2aa927f32bb92d65f6161ed71abdaa4f50c1257a556', 'b5974375791fb9946a41c2d13f4893bb23ff9aab23843b86a8a6c87b84379b21',/*Lightning Exchange Rates*/ 'e7bf8dad360828f0289b7b4bea1a1bd28eb6d4d6522fa17f957e0dfb839ef3db', /*BTC Blockchain Status*/ 'fdfefa96f9591f7f90cf4a6c31630826532a1f0d195a05c9bec604953736b8f9' /*Remaining BTC Mining Pool*/ ]), /* Mastodon - Spam */ new PubkeyBanPolicy([ '033d385a160352ea07fc01db6823ba2beaf1a99174809f96e49767e31a6dfca2' ]), /* NSFW - Porn */ new PubkeyBanPolicy([ 'b5ac48ab0a458fb9d6c5728b2751cadfae51e6378726d1a6b87511ec823e74d1', '6024aa81243e2935476a3ca472b35fc0d2e347efc5590b6af42bf113afc54e31', 'e81ad66d10a5a53f6ffe67bf3407e18e52448b077db461d1993f8e142039004e', 'dadb6a25154749547a3c8a610e2793b79171485795ecbe3fe4832eb1ac1c6da9', 'cd2213a845a78674c31f5ab8b1bb2e5d4c4d112719d632846d4a2bfeeae87d6f', '75c3a885aa742d43712cfd19ae5ab61672a13b025406a4d6c82e51a362ff248e', 'a99bc6583536c7f1ca9422501846753b431ce900c8808dddcf4ad5ec6f6e4ea8', 'd2c8c0cabfa8d99fde0df1a9200ddc6540d2f938f879832730d9fcbc3094e4a0', '1450c4acffd3736b9e7f680448f62a3ee8c3593d734302832731e24e18b7ad90', '6a6c7dd2fab5a7c29ffb51cf91c1e9e924d60800d65a72547eebdefd267f08a4', 'd4aa2cdbe0f225f6cb7a0856f9e09beb69b3bc3740c6061623d04b7f421a7d21', '3fbfe3aaa07807a2e6901cd27b620f8d8b523cc42131ea28381dd49a7a22391a', 'e52f62051459e8b3ef9ed32a000f7421817b3410a48e788ecba6a927b488d664', '5339d722acc18ad6fcd5f8d4ea6595cb5e2c034ed5baad0064d430eb04ccfde1', '75a8daa0396e9aedf36b898b7089cf1072621d21357629e23b43f06640bbc761', 'c5953e3197e82af56a91ab14ea075cadd99c6ea05f73abafa3506ae56c605a86', '9ab7d04fccf9ea91387b36d1c1ff86b84437a4c5cd2aa253c5d1f5ef7bb6586b', '16ea051a85cfc66cdedd51c8928af6e6666b2c0ffe2c2d3dd855c5ad6461c8f3', 'a48a5a6e90a85415d0fd94e9ca7631e97e548b0b1dc0bb5bafb5aac534eb356b', '91a345a9dda351bf1bc6140c70902b2fca3343e7b8285f68d282b1949689601a', '455cf4b21dbdf1f928772809d2dd674d61d4bc221ac41532ba3db6b29df7280e', '2a029d79d2e4a5894fa479ec0306632fbf96a4022e900b64def402471e7a74df', '41c247a3e9c93a994977305885586cb933567045ff9b9bed6f8ebc57cdf1f2d7', 'd38b4595f73619c14871c39fface15b6ecaa5284e473ff206aaee4f6f4044403' ]), new AntiDuplicationPolicy({ kv, minLength: 50 }), ]); return policy.call(event); } }