J-Rios / TLG_JoinCaptchaBot

Telegram Bot to verify if users joining a group are human. The Bot sends an image captcha for each new user and kicks any of them who can't solve the captcha in a specified time.
GNU General Public License v3.0
516 stars 217 forks source link

[Request] Delay before sending captcha #86

Closed FriendlyNeighborhoodShane closed 3 years ago

FriendlyNeighborhoodShane commented 3 years ago

When a user joins a group with "Show history for new members" disabled, the bot is sometimes too quick to send the captcha, such that it isn't even visible to the new user.

This is most probably a bug on Telegram's side, but it would be useful to add a delay (~2-5 seconds) between recieving the event from telegram and sending a captcha.

Thanks for the great bot!

J-Rios commented 3 years ago

Hi,

I see your point, but I'm affraid doing that change increase a lot the resources needed by the Bot to handle the delays without affecting general Bot response time (due it can't be done inside the received telegeram event handler, it should be stored and manage independently), so is not acceptable to make that change.

If the Bot is going to be used in few groups (less than hundred), it can be accepted, but not for a Bot running in thousands of groups.

Regards.

FriendlyNeighborhoodShane commented 3 years ago

I think just adding a time.sleep(2) statement at line 593 of join_captcha_bot.py would be sufficient for this. Since the receiver runs async anyway.

FriendlyNeighborhoodShane commented 3 years ago

Actually NVM, we don't require this anymore, so unless this is something that you want to pursue, I'll close it.