From df5de3e5836e77792aca22509d8f94bd041ae9b5 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Tue, 4 Feb 2020 17:03:33 +0100 Subject: [PATCH] Revert "Add missing file_ref in set_chat_photo (#343)" (#366) This reverts commit e316d18bf4bfcae7113588abcc5e021577a39f12. --- pyrogram/client/methods/chats/set_chat_photo.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pyrogram/client/methods/chats/set_chat_photo.py b/pyrogram/client/methods/chats/set_chat_photo.py index 689cc15f..4c912475 100644 --- a/pyrogram/client/methods/chats/set_chat_photo.py +++ b/pyrogram/client/methods/chats/set_chat_photo.py @@ -27,8 +27,7 @@ class SetChatPhoto(BaseClient): async def set_chat_photo( self, chat_id: Union[int, str], - photo: str, - file_ref: str = None, + photo: str ) -> bool: """Set a new profile photo for the chat. @@ -41,10 +40,6 @@ class SetChatPhoto(BaseClient): photo (``str``): New chat photo. You can pass a :obj:`Photo` file_id or a file path to upload a new photo from your local machine. - - file_ref (``str``, *optional*): - A valid file reference obtained by a recently fetched media message. - To be used in combination with a file id in case a file reference is needed. Returns: ``bool``: True on success. @@ -59,14 +54,14 @@ class SetChatPhoto(BaseClient): app.set_chat_photo(chat_id, "photo.jpg") # Set chat photo using an exiting Photo file_id - app.set_chat_photo(chat_id, photo.file_id, photo.file_ref) + app.set_chat_photo(chat_id, photo.file_id) """ peer = await self.resolve_peer(chat_id) if os.path.exists(photo): photo = types.InputChatUploadedPhoto(file=await self.save_file(photo)) else: - photo = utils.get_input_media_from_file_id(photo, file_ref, 2) + photo = utils.get_input_media_from_file_id(photo) photo = types.InputChatPhoto(id=photo.id) if isinstance(peer, types.InputPeerChat):