set_chat_ttl()

async Client.set_chat_ttl()

Set the auto-delete timer of a chat.

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

  • ttl_seconds (int) – Time to live of the messages, in seconds. Pass 0 to disable the auto-delete timer.

Returns:

Message – On success, the generated service message is returned.

Example

await app.set_chat_ttl(chat_id, 86400)