File tree Expand file tree Collapse file tree
pyrogram/client/methods/users Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818
1919from pyrogram .api import functions
2020from ...ext import BaseClient
21+ from typing import Union , BinaryIO
2122
2223
2324class SetProfilePhoto (BaseClient ):
2425 def set_profile_photo (
2526 self ,
26- photo : str
27+ photo : Union [ str , BinaryIO ]
2728 ) -> bool :
2829 """Set a new profile photo.
2930
31+ If you want to set a profile video instead, use :meth:`~Client.set_profile_video`
32+
3033 This method only works for Users.
3134 Bots profile photos must be set using BotFather.
3235
3336 Parameters:
3437 photo (``str``):
3538 Profile photo to set.
36- Pass a file path as string to upload a new photo that exists on your local machine.
39+ Pass a file path as string to upload a new photo that exists on your local machine or
40+ pass a binary file-like object with its attribute ".name" set for in-memory uploads.
3741
3842 Returns:
3943 ``bool``: True on success.
You can’t perform that action at this time.
0 commit comments