set_chat_title()#
- Client.set_chat_title()[source]#
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.
Usable by ✅ Users ✅ BotsNote
In regular groups (non-supergroups), this method will only work if the “All Members Are Admins” setting is off.
- Parameters:
chat_id (
int|str) – Unique identifier (int) or username (str) of the target chat.title (
str) – New chat title, 1-255 characters.
- Returns:
Message|bool– On success, a service message will be returned (when applicable), otherwise, in case a message object couldn’t be returned, True is returned.- Raises:
ValueError – In case a chat id belongs to user.
Example
await app.set_chat_title(chat_id, "New Title")