radio-t / super-bot

radio-t bot слушает чат telegram и реагирует на определенные команды и фрагменты текста.
MIT License
63 stars 31 forks source link

add spam filter with CAS api https://cas.chat/api #114

Closed umputun closed 1 year ago

umputun commented 1 year ago

this PR adds a check via https://api.cas.chat/check?user_id=<id> API on a first message. If the user ID is passed, added to the approved list and won't run a check on that ID anymore

If the user is a spammer, it will be blocked permanently, and the message will be deleted. Dry mode won't remove message and won't ban, just reply with a warning.

github-actions[bot] commented 1 year ago

Pull Request Test Coverage Report for Build 6443919340


Changes Missing Coverage Covered Lines Changed/Added Lines %
app/events/telegram.go 8 10 80.0%
app/bot/spam.go 34 42 80.95%
<!-- Total: 42 52 80.77% -->
Totals Coverage Status
Change from base Build 6134770322: -0.01%
Covered Lines: 2379
Relevant Lines: 2960

💛 - Coveralls
umputun commented 1 year ago

@paskal - can you take a look pls?

umputun commented 1 year ago

@paskal I have addressed all those except the last one (adding test). It looks like you were the one who added all the tg tests and if you can cover delete too it will be great.

paskal commented 1 year ago

Added a test in a separate commit.