set_chat_member_tag()#

Client.set_chat_member_tag()#

Set a tag or custom title for a regular member in a group or a supergroup.

Usable by Users Bots

The client must be an administrator in the chat (for basic groups and supergroups only) for this to work and must have the can_manage_tags administrator right.

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) – The new tag of the member in the chat. 0-16 characters without emoji. Pass None or “” (empty string) to remove the custom title.

Returns:

bool – True on success.

Example

await app.set_chat_member_tag(chat_id, user_id, "Member Tag")