SetPrivacyRequest
Only users can use this request. See code examples.
---functions--- account.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector<InputPrivacyRule> = account.PrivacyRules
Returns
account.PrivacyRules |
This type can only be an instance of:
PrivacyRules |
Parameters
key | InputPrivacyKey | |
rules | InputPrivacyRule | A list must be supplied. |
Known RPC errors
This request can cause 2 known errors:
PrivacyKeyInvalidError | The privacy key is invalid. |
PrivacyTooLongError | Cannot add that many entities in a single request. |
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.account.SetPrivacyRequest( key=types.InputPrivacyKeyStatusTimestamp(), rules=[types.InputPrivacyValueAllowContacts()] )) print(result.stringify())