UpdateProfilePhotoRequest
Only users can use this method. See code examples.
---functions--- photos.updateProfilePhoto#1c3d5956 flags:# fallback:flags.0?true id:InputPhoto = photos.Photo
Returns
| photos.Photo |
This type can only be an instance of:
| Photo |
Parameters
| id | InputPhoto | |
| fallback | flag | This argument defaults to None and can be omitted. |
Known RPC errors
This request can cause 1 known error:
PhotoIdInvalidError | Photo id 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.photos.UpdateProfilePhotoRequest(
id=types.InputPhoto(
id=-12398745604826,
access_hash=-12398745604826,
file_reference=b'arbitrary\x7f data \xfa here'
),
fallback=True
))
print(result.stringify())