Closed umputun closed 1 year ago
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 | |
---|---|
Change from base Build 6134770322: | -0.01% |
Covered Lines: | 2379 |
Relevant Lines: | 2960 |
@paskal - can you take a look pls?
@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.
Added a test in a separate commit.
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 anymoreIf 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.