set_chat_member_tag()

Client.set_chat_member_tag()

Use this method to set a tag for a regular member in a group or a supergroup.

Note

The bot must be an administrator in the chat for this to work and must have the can_manage_tags administrator right.

Usable by Users Bots
Parameters:
  • chat_id (int | str) – Unique identifier (int) or username (str) of the target chat.

  • 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).

  • tag (str, optional) – New tag for the member, 0-16 characters, emoji are not allowed.

Returns:

bool – True on success.

Example

await app.set_chat_member_tag(chat_id, user_id, "Cool guy")