channels.EditAdmin

class pyrogram.raw.functions.channels.EditAdmin

Modify the admin rights of a user in a supergroup/channel.

Details:
  • Layer: 223

  • ID: 9A98AD68

Parameters:
  • channel (InputChannel) – The supergroup/channel.

  • user_id (InputUser) – The ID of the user whose admin rights should be modified

  • admin_rights (ChatAdminRights) – The admin rights

  • rank (str, optional) – Indicates the role (rank) of the admin in the group: just an arbitrary string

Returns:

Updates

TL Schema

channels.editAdmin#9a98ad68
flags:#
channel:InputChannel
user_id:InputUser
admin_rights:ChatAdminRights
rank:flags.0?string

= Updates

Parameter Tree

EditAdmin
├── channelInputChannel
│ ├── InputChannelEmpty
│ ├── InputChannel
│ │ ├── channel_idlong
│ │ └── access_hashlong
│ ├── peerInputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_idint
│ └── channel_idlong
├── user_idInputUser
│ ├── InputUserEmpty
│ ├── InputUserSelf
│ ├── InputUser
│ │ ├── user_idlong
│ │ └── access_hashlong
│ └── InputUserFromMessage
│ ├── peerInputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_idint
│ └── user_idlong
├── admin_rightsChatAdminRights
│ └── ChatAdminRights
│ ├── change_infotrue (optional)
│ ├── post_messagestrue (optional)
│ ├── edit_messagestrue (optional)
│ ├── delete_messagestrue (optional)
│ ├── ban_userstrue (optional)
│ ├── invite_userstrue (optional)
│ ├── pin_messagestrue (optional)
│ ├── add_adminstrue (optional)
│ ├── anonymoustrue (optional)
│ ├── manage_calltrue (optional)
│ ├── othertrue (optional)
│ ├── manage_topicstrue (optional)
│ ├── post_storiestrue (optional)
│ ├── edit_storiestrue (optional)
│ ├── delete_storiestrue (optional)
│ ├── manage_direct_messagestrue (optional)
│ └── manage_rankstrue (optional)
└── rankstring (optional)

Example

await app.invoke(
    EditAdmin(
        channel=await app.resolve_channel(chat_id),
        user_id=await app.resolve_user(chat_id),
        admin_rights=ChatAdminRights(
            change_info=None,
            post_messages=None,
            edit_messages=None,
            delete_messages=None,
            ban_users=None,
            invite_users=None,
            pin_messages=None,
            add_admins=None,
            anonymous=None,
            manage_call=None,
            other=None,
            manage_topics=None,
            post_stories=None,
            edit_stories=None,
            delete_stories=None,
            manage_direct_messages=None,
            manage_ranks=None
        ),
        rank="text",
    )
)