UpdateProfilePhotoRequest
Only users can use this request. See code examples.
---functions--- photos.updateProfilePhoto#09e82039 flags:# fallback:flags.0?true bot:flags.1?InputUser 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. |
bot | InputUser | This argument defaults to None and can be omitted. Anything entity-like will work if the library can find its Input version (e.g., usernames, Peer , User or Channel objects, etc.). |
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, bot='username' )) print(result.stringify())