Change /unmute command so that the exception on permissions is dropped#52
Open
keobox wants to merge 1 commit into
Open
Change /unmute command so that the exception on permissions is dropped#52keobox wants to merge 1 commit into
keobox wants to merge 1 commit into
Conversation
MattiaFailla
requested changes
Jun 4, 2026
Comment on lines
-365
to
-367
| can_change_info=False, | ||
| can_change_info=True, | ||
| can_invite_users=True, | ||
| can_pin_messages=False, |
Member
There was a problem hiding this comment.
Pinning messages and changing group-related info are not privileges granted to normal users: I'd revert this change.
Author
There was a problem hiding this comment.
This will re-introduce the bug
- restrictChatMember with can_pin_messages=True does NOT mean "this user can pin messages." It means "remove the per-user restriction on this permission" the user falls back to group defaults.
- restrictChatMember with can_pin_messages=False means "explicitly restrict this user from pinning, regardless of group defaults."
This creates/keeps a per-user exception.
The Telegram Bot API docs are explicit:
"Pass True for all permissions to lift restrictions from a user."
If even one permission is False, Telegram keeps the per-user restriction record which is exactly the bug we're seeing (users appear restricted in the member list, /unmute "succeeds" but changes nothing visible).
Comment on lines
+135
to
+137
| can_change_info=True, | ||
| can_invite_users=True, | ||
| can_pin_messages=False, | ||
| can_pin_messages=True, |
Member
There was a problem hiding this comment.
Must be reverted in here too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
I've 4 stale users sitting in a muted state forever in the @PythonMilano telegram channel.
Behavior
I'm experiencing This.
The captcha for new user maybe was not displayed, but for sure is not displayed if a user leave the group and then tries to subscribe again.
New users are subscribed but muted meaning that the default permission are overridden by exceptions for them. I suspect that the exception are not cleared from the bot database once a user unsubscribe. Another bug is that the
/unmutecommand does not remove the exception, the result looks like a user is muted forever.How to test it
In the https://t.me/PythonMilano there are currently 4 stale users, I know this people personally and I want to un-mute them even if they do not clicked the captcha.