promote_chat_member()

Client.promote_chat_member()

Promote or demote a user in a supergroup or a channel.

You must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.

Usable by Users Bots
Parameters:
  • chat_id (int | str) – Unique identifier (int) or username (str) of the target chat. You can also use chat public link in form of t.me/<username> (str).

  • user_id (int | str) – Unique identifier (int) or username (str) of the target user. For a contact that exists in your Telegram address book you can use his phone number (str). You can also use user profile link in form of t.me/<username> (str).

  • privileges (ChatPrivileges, optional) – New user privileges.

  • title – (str, optional): A custom title that will be shown to all members instead of “Owner” or “Admin”. Pass None or “” (empty string) will keep the current title. If you want to delete the custom title, use set_administrator_title() method.

Returns:

bool – True on success.

Example

# Promote chat member to admin
await app.promote_chat_member(chat_id, user_id)