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

Fix users being banned permanently #192

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ayaka14732
Copy link

@ayaka14732 ayaka14732 commented Aug 16, 2022

In the previous version, when chat.banUsers is set to false, we use parseInt(`${new Date().getTime() / 1000 + 45}`) to ban a user for 45 seconds. The intention is that the ban will be automatically lifted after 45 seconds.

Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.

In practice, however, this often does not work, and will cause the user to be banned permanently, which has been raised in #106.

In this pull request, I substitute the 45-second approach with the bot.telegram.unbanChatMember API, which will remove a member from the chat (similar to bot.telegram.kickChatMember) but without banning it.

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.

1 participant