Skip to content

Commit 79a04f2

Browse files
committed
Merge branch 'develop' into asyncio-dev
2 parents ccbe9b4 + 2482358 commit 79a04f2

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

pyrogram/client/methods/users/delete_profile_photos.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
1818

19-
from struct import unpack
2019
from typing import List, Union
2120

22-
from pyrogram.api import functions, types
21+
from pyrogram.api import functions
2322
from pyrogram.client.ext import utils
2423
from ...ext import BaseClient
2524

@@ -52,18 +51,7 @@ async def delete_profile_photos(
5251
app.delete_profile_photos([p.file_id for p in photos[1:]])
5352
"""
5453
photo_ids = photo_ids if isinstance(photo_ids, list) else [photo_ids]
55-
input_photos = []
56-
57-
for photo_id in photo_ids:
58-
unpacked = unpack("<iiqqc", utils.decode_file_id(photo_id))
59-
60-
input_photos.append(
61-
types.InputPhoto(
62-
id=unpacked[2],
63-
access_hash=unpacked[3],
64-
file_reference=b""
65-
)
66-
)
54+
input_photos = [utils.get_input_media_from_file_id(i).id for i in photo_ids]
6755

6856
return bool(await self.send(
6957
functions.photos.DeletePhotos(

0 commit comments

Comments
 (0)