Skip to content

Allow anonymous admins to use admin scoped commands #74

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

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

Conversation

rayz1065
Copy link
Member

@rayz1065 rayz1065 commented Aug 6, 2025

Currently anonymous admins are unable to use admin scoped commands, despite them being displayed in the user interface. The docs say about sender_chat:

Optional. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. [...]

There should be no other way to send a message on behalf of a group.

This pull request updates the isAdmin function to take into account anonymous admins.

roziscoding
roziscoding previously approved these changes Aug 7, 2025
Copy link
Contributor

@roziscoding roziscoding left a comment

Choose a reason for hiding this comment

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

thought
@carafelix can you please TAL at this?

Copy link
Member

@carafelix carafelix left a comment

Choose a reason for hiding this comment

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

Really glad to see this PR. A well thought addition.

Requested changes are mostly about unused lines.

I think lines 1030-1032 need an explanation or change.

Thanks for checking out on this.

Remove `from` field when `sender_chat` is specified in test

Co-authored-by: Hero Protagonist <[email protected]>
Copy link
Member

@carafelix carafelix left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the further explanations

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.

3 participants