channels.EditAdmin

class pyrogram.raw.functions.channels.EditAdmin

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

Details:
  • Layer: 227

  • 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
├── channel → InputChannel
│ ├── InputChannelEmpty
│ ├── InputChannel
│ │ ├── channel_id → long
│ │ └── access_hash → long
│ ├── peer → InputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_id → int
│ └── channel_id → long
├── user_id → InputUser
│ ├── InputUserEmpty
│ ├── InputUserSelf
│ ├── InputUser
│ │ ├── user_id → long
│ │ └── access_hash → long
│ └── InputUserFromMessage
│ ├── peer → InputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_id → int
│ └── user_id → long
├── admin_rights → ChatAdminRights
│ └── ChatAdminRights
│ ├── change_info → true (optional)
│ ├── post_messages → true (optional)
│ ├── edit_messages → true (optional)
│ ├── delete_messages → true (optional)
│ ├── ban_users → true (optional)
│ ├── invite_users → true (optional)
│ ├── pin_messages → true (optional)
│ ├── add_admins → true (optional)
│ ├── anonymous → true (optional)
│ ├── manage_call → true (optional)
│ ├── other → true (optional)
│ ├── manage_topics → true (optional)
│ ├── post_stories → true (optional)
│ ├── edit_stories → true (optional)
│ ├── delete_stories → true (optional)
│ ├── manage_direct_messages → true (optional)
│ └── manage_ranks → true (optional)
└── rank → string (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",
    )
)