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
532 stars 218 forks source link

[Request] Restrict new users to send media #78

Closed SA7BNT closed 3 years ago

SA7BNT commented 3 years ago

Hey, im running into an issue with the bot and cant figure out why. When a new user is coming to the group the user got the captcha from the bot. After he write in the right captcha the entry to the group is done. But here im getting the issue. When i then looking at the right for the new user the bot has restricted the rights so that the user cant share pics or something else. The admin must always switch the rights so the new users can share pics or other stuff. What am i missing?? Bot is running as admin and i just updated to the latest version of the JoinCaptchaBot. Is there some new config i do not know about or missing??

J-Rios commented 3 years ago

Hi,

That seems like you have turn on the restrict new users option with command /restrict_non_text. This command do exactly that, all new users will be restricted to just send text (no media( messages.

/restrict_non_text - Enable apply restriction to recently joined users to send non-text messages.

You can disable it by: /restrict_non_text disable

I'm affraid that it is a dangerous command that some users can enable it by mistake... Maybe I should do something about it.

Regards.

SA7BNT commented 3 years ago

Hey, thanks for your replay. I wasn't aware of that. :( i will try that. BTW if you will change that will it be a good idea to put some (timer) into that?? Thinking about that new users can be restricted 10min/1 hour or maybe up to days and the bot after that time will change the rights for the user?? And if the timer is not running out of the configured time an admin can change it earlier. How are you thinking about that?

stilicrafter commented 3 years ago

I like the Timer idea . 👍

E2w4UmWh commented 3 years ago

Hi all, I'm running into the same issue. By default, CaptcaBot sets all restrictions to permancent ("Dauerhaft"):

grafik "Eingeschränkt bis" = restricted until.

In general it's good idea to restrict new users from sending media files. Most of the spammers register to a group (and some of them are alble to solve even a captcha) but do not wait very long to send their spam stuff. However running a group with around 800 participants, it's almost impossible to delete all restrictions for new members manually, after a while.

Having something like a timer, is a great idea! I however do not see the need that CapchaBot has to handle this timer itself. Telegram already has a timer mechanism built in. The only thing required, is the possibility that CaptchaBot does set the restrictions to 1 Week ("für 1 Woche") or 1 Day ("für 1 Tag"), instead of setting it to permanently. The timing itself will be handled by Telegram alone.

Do you think, that can be implemented without huge programming efforts? Would be extremely helpful, handling large groups!

J-Rios commented 3 years ago

I will take a look into that time restriction, as you have said, it should not need a big effort if we can let Telegram Server handle it :)

J-Rios commented 3 years ago

Ok, after these changes, Bot should restrict send media messages for just 1 day by default when /restrict_non_text is enabled.

Also, to keep the restrict forever functionality available, it can also be specify with "forever" keyword:

# Enable restrict for 1 day
/restrict_non_text enable

# Enable restrict forever
/restrict_non_text enable forever

# Disable restrict
/restrict_non_text  disable

All groups that has /restrict_non_text enabled, has been turn to 1 day restriction instead forever.

Let's see in these days if the restriction is set-unset ok by Telegram Server, if all goes well the issue will be closed.

Best Regards.

SA7BNT commented 3 years ago

Ok, after these changes, Bot should restrict send media messages for just 1 day by default when /restrict_non_text is enabled.

Also, to keep the restrict forever functionality available, it can also be specify with "forever" keyword:

# Enable restrict for 1 day
/restrict_non_text enable

# Enable restrict forever
/restrict_non_text enable forever

# Disable restrict
/restrict_non_text  disable

All groups that has /restrict_non_text enabled, has been turn to 1 day restriction instead forever.

Let's see in these days if the restriction is set-unset ok by Telegram Server, if all goes well the issue will be closed.

Best Regards.

Great job. Thanks for add this feature. Is also easy to customize the timer. Thanks for that