set_chat_ttl()¶
- Client.set_chat_ttl()¶
Set the time-to-live for the chat.
Usable by Users Bots- Parameters:
chat_id (
int|str) – Unique identifier (int) or username (str) of the target chat.ttl_seconds (
int) – The time-to-live for the chat. Either 86000 for 1 day, 604800 for 1 week or 0 (zero) to disable it.
- Returns:
bool– True on success.
Example
# Set TTL for a chat to 1 day await app.set_chat_ttl(chat_id, 86400) # Set TTL for a chat to 1 week await app.set_chat_ttl(chat_id, 604800) # Disable TTL for this chat await app.set_chat_ttl(chat_id, 0)