Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set up custom ban duration via CAPTCHABOT_BAN_DURATION option #204

Merged

Conversation

alex-pobeditel-2004
Copy link
Contributor

I'm not sure if this feature is needed by the community, but in our chat, we decided to give users temporary bans to prevent them from instantly rejoining (we use this bot as a soft power tool, just to let users know they've chosen the wrong chat).

I found that tlgbotutils.tlg_ban_user already has a parameter for ban duration, so I added a configuration option to specify it. By default, it's set to -1, which means an indefinite ban, so backward compatibility is maintained.

Important: I didn’t change the localization texts for the ban to avoid overcomplicating the logic, so the ban message still says that a chat admin needs to manually unban the user.

Copy link
Owner

@J-Rios J-Rios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Alex,

Thanks for the contribution, even if it is not requested by the community, it's a nice to have feature.

Merging 👍

@J-Rios J-Rios merged commit 77c3af4 into J-Rios:master Oct 20, 2024
1 check passed
@alex-pobeditel-2004 alex-pobeditel-2004 deleted the feature/custom-ban-duration branch October 20, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants