From 40bcd4e59d8b96b2dddd70ce810006988672101d Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 26 Jun 2019 21:43:08 +0200 Subject: [PATCH] Fix delete_profile_photos. Closes #259 --- .../methods/users/delete_profile_photos.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pyrogram/client/methods/users/delete_profile_photos.py b/pyrogram/client/methods/users/delete_profile_photos.py index 1b46382c..a165f7d1 100644 --- a/pyrogram/client/methods/users/delete_profile_photos.py +++ b/pyrogram/client/methods/users/delete_profile_photos.py @@ -16,23 +16,24 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from base64 import b64decode from struct import unpack from typing import List, Union from pyrogram.api import functions, types +from pyrogram.client.ext import utils + from ...ext import BaseClient class DeleteProfilePhotos(BaseClient): def delete_profile_photos( self, - id: Union[str, List[str]] + photo_ids: Union[str, List[str]] ) -> bool: """Delete your own profile photos. Parameters: - id (``str`` | ``list``): + photo_ids (``str`` | List of ``str``): A single :obj:`Photo` id as string or multiple ids as list of strings for deleting more than one photos at once. @@ -42,16 +43,16 @@ class DeleteProfilePhotos(BaseClient): Raises: RPCError: In case of a Telegram RPC error. """ - id = id if isinstance(id, list) else [id] + photo_ids = photo_ids if isinstance(photo_ids, list) else [photo_ids] input_photos = [] - for i in id: - s = unpack("