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
515 stars 217 forks source link

[Request] Remove all messages from a user that fail the captcha #120

Closed eshkaflex closed 2 years ago

eshkaflex commented 2 years ago

i see that bot don't delete messages from user that not completed captcha and after user get kicked by bot - messages stay in chat

J-Rios commented 2 years ago

Context

Once a new user joins a group, the Bot will send the captcha and let him to write into the group for solve image captchas, however, the user could ignore the captcha and send any message not related to captcha completion.

The Bot will directly remove any non-text messages and text messages that can be considered Spam (messages with URLs or @alias on it), but any other message are kept in the chat without being removed.

When the captcha process ends, the Bot remove any captcha process related messages, except normal text messages that are not Spam and not related to Captcha.

J-Rios commented 2 years ago

The reason to kept this messages and not being deleted is tmfor the cases where a new user are not related to captchas and doesn't know how to solve it. It allows a user to ask for help to others users of the group, and this messages could remains in the chat and allow an Admin or other member of the group to know that a user has join the group, asked for help regarding how to solve the caltcha, but was kicked without getting any help...

So, it is really a good idea to also remove any messages?

eshkaflex commented 2 years ago

Can you make a feature that the admin can turn on or off that removes messages from a user who has not complete a captcha?

J-Rios commented 2 years ago

Sure, optionally features that are disabled by default and can be turned on by an Admin is ok.

thinkl33t commented 2 years ago

We're getting a lot of bots joining our channel at the moment, saying "Hi everybody" then getting kicked, so having this feature would be excellent!

AGulev commented 2 years ago

this morning I found about 15 "Hi everybody)" in my chat from bots. They started to post a message right after they enter a chat (

J-Rios commented 2 years ago

I see the same in some groups, damn bots :(

Let me implement this feature...

J-Rios commented 2 years ago

Done,

The next new commands are implemented to enable or disable removing all messages:

/remove_all_msg_kick_on /remove_all_msg_kick_off

Default it is off, same as we have until now, but turning it on should makes "Hi every body" (and other texts messages) to also be deleted when the user is kicked from the group...

AGulev commented 2 years ago

Done,

The next new commands are implemented to enable or disable removing all messages:

/remove_all_msg_kick_on /remove_all_msg_kick_off

Default it is off, same as we have until now, but turning it on should makes "Hi every body" (and other texts messages) to also be deleted when the user is kicked from the group...

When I try to use this command I get :

This command cannot be used in private chat unless you make a connection (/connect) to configure some group.

But I connected to a chat:

Connected to group -****. Now you can configure group captcha settings from private.
J-Rios commented 2 years ago

Thanks for reporting, you are right, I miss to add this commands configurations through private chat. I will fix that tomorrow, currently you can use the commands from inside the group.

Regards.

J-Rios commented 2 years ago

Fixed, configuration using this new commands through private chat with /connect should works now.

AGulev commented 2 years ago

Everything works fine, thank you!!!