Skip to content

Commit b205c6c

Browse files
committed
Rename Photos to ProfilePhotos
1 parent 8151270 commit b205c6c

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

docs/source/api/types.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Messages & Media
4545
- :class:`Messages`
4646
- :class:`MessageEntity`
4747
- :class:`Photo`
48-
- :class:`Photos`
48+
- :class:`ProfilePhotos`
4949
- :class:`Thumbnail`
5050
- :class:`Audio`
5151
- :class:`Document`
@@ -133,7 +133,7 @@ Details
133133
.. autoclass:: Messages()
134134
.. autoclass:: MessageEntity()
135135
.. autoclass:: Photo()
136-
.. autoclass:: Photos()
136+
.. autoclass:: ProfilePhotos()
137137
.. autoclass:: Thumbnail()
138138
.. autoclass:: Audio()
139139
.. autoclass:: Document()

pyrogram/client/methods/users/get_profile_photos.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_profile_photos(
2929
chat_id: Union[int, str],
3030
offset: int = 0,
3131
limit: int = 100
32-
) -> "pyrogram.Photos":
32+
) -> "pyrogram.ProfilePhotos":
3333
"""Get a list of profile pictures for a user or a chat.
3434
3535
Parameters:
@@ -47,15 +47,15 @@ def get_profile_photos(
4747
Values between 1—100 are accepted. Defaults to 100.
4848
4949
Returns:
50-
:obj:`Photos`: On success, an object containing a list of the profile photos is returned.
50+
:obj:`ProfilePhotos`: On success, an object containing a list of the profile photos is returned.
5151
5252
Raises:
5353
RPCError: In case of a Telegram RPC error.
5454
"""
5555
peer_id = self.resolve_peer(chat_id)
5656

5757
if isinstance(peer_id, types.InputPeerUser):
58-
return pyrogram.Photos._parse(
58+
return pyrogram.ProfilePhotos._parse(
5959
self,
6060
self.send(
6161
functions.photos.GetUserPhotos(
@@ -86,7 +86,7 @@ def get_profile_photos(
8686
)
8787
)
8888

89-
return pyrogram.Photos(
89+
return pyrogram.ProfilePhotos(
9090
total_count=new_chat_photos.total_count,
91-
photos=[m.new_chat_photo for m in new_chat_photos.messages][:limit]
91+
profile_photos=[m.new_chat_photo for m in new_chat_photos.messages][:limit]
9292
)

pyrogram/client/types/messages_and_media/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@
2828
from .photo import Photo
2929
from .poll import Poll
3030
from .poll_option import PollOption
31+
from .profile_photos import ProfilePhotos
3132
from .sticker import Sticker
3233
from .stripped_thumbnail import StrippedThumbnail
3334
from .thumbnail import Thumbnail
34-
from .photos import Photos
3535
from .venue import Venue
3636
from .video import Video
3737
from .video_note import VideoNote
3838
from .voice import Voice
3939

4040
__all__ = [
4141
"Animation", "Audio", "Contact", "Document", "Game", "Location", "Message", "MessageEntity", "Messages", "Photo",
42-
"Thumbnail", "StrippedThumbnail", "Poll", "PollOption", "Sticker", "Photos", "Venue", "Video", "VideoNote", "Voice"
42+
"Thumbnail", "StrippedThumbnail", "Poll", "PollOption", "Sticker", "ProfilePhotos", "Venue", "Video", "VideoNote",
43+
"Voice"
4344
]

pyrogram/client/types/messages_and_media/photos.py renamed to pyrogram/client/types/messages_and_media/profile_photos.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,35 +23,35 @@
2323
from ..object import Object
2424

2525

26-
class Photos(Object):
26+
class ProfilePhotos(Object):
2727
"""Contains a user's profile pictures.
2828
2929
Parameters:
3030
total_count (``int``):
3131
Total number of profile pictures the target user has.
3232
33-
photos (List of :obj:`Photo`):
33+
profile_photos (List of :obj:`Photo`):
3434
Requested profile pictures.
3535
"""
3636

37-
__slots__ = ["total_count", "photos"]
37+
__slots__ = ["total_count", "profile_photos"]
3838

3939
def __init__(
4040
self,
4141
*,
4242
client: "pyrogram.BaseClient" = None,
4343
total_count: int,
44-
photos: List[Photo]
44+
profile_photos: List[Photo]
4545
):
4646
super().__init__(client)
4747

4848
self.total_count = total_count
49-
self.photos = photos
49+
self.profile_photos = profile_photos
5050

5151
@staticmethod
52-
def _parse(client, photos) -> "Photos":
53-
return Photos(
52+
def _parse(client, photos) -> "ProfilePhotos":
53+
return ProfilePhotos(
5454
total_count=getattr(photos, "count", len(photos.photos)),
55-
photos=[Photo._parse(client, photo) for photo in photos.photos],
55+
profile_photos=[Photo._parse(client, photo) for photo in photos.photos],
5656
client=client
5757
)

0 commit comments

Comments
 (0)