set_chat_title()

Client.set_chat_title()

Change the title of a chat. Titles can’t be changed for private chats. You must be an administrator in the chat for this to work and must have the appropriate admin rights.

Note

In regular groups (non-supergroups), this method will only work if the “All Members Are Admins” setting is off.

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

  • title (str) – New chat title, 1-255 characters.

Returns:

bool – True on success.

Raises:

ValueError – In case a chat id belongs to user.

Example

await app.set_chat_title(chat_id, "New Title")