umputun / tg-spam

Anti-Spam bot for Telegram and anti-spam library
https://tg-spam.umputun.dev
MIT License
221 stars 39 forks source link

Multi first #21

Closed umputun closed 11 months ago

umputun commented 11 months ago

Adds support for checking multiple first messages before the user gets approved. The default for --first-messages-count env:"FIRST_MESSAGES_COUNT" is still 1, as before, but can be set to any other number. If --paranoid is set to true the --first-messages-count flag is ignored.

The reason for this change is that some smart bots can enter the chat and start to post non-spam messages first to gain some trust and start to spam after this.

The change if back compatible on both the library and bot level. This adds some redundancy because, technically speaking, having both FirstMessage and FirstMessagesCount fields (lib.Detector) is not needed, but I don't want to break existing clients.