SetHistoryTTLRequest
Only users can use this request. See code examples.
---functions--- messages.setHistoryTTL#b80e5fe4 peer:InputPeer period:int = Updates
Returns
Updates |
This type can be an instance of either:
UpdateShort | UpdateShortChatMessage |
UpdateShortMessage | UpdateShortSentMessage |
Updates | UpdatesCombined |
UpdatesTooLong |
Parameters
peer | InputPeer | Anything entity-like will work if the library can find its Input version (e.g., usernames, Peer , User or Channel objects, etc.). |
period | int |
Known RPC errors
This request can cause 2 known errors:
ChatNotModifiedError | The chat or channel wasn't modified (title, invites, username, admins, etc. are the same). |
TtlPeriodInvalidError | The provided TTL Period is invalid. |
You can import these from telethon.errors
.
Example
from telethon.sync import TelegramClient from telethon import functions, types with TelegramClient(name, api_id, api_hash) as client: result = client(functions.messages.SetHistoryTTLRequest( peer='username', period=42 )) print(result.stringify())