mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-12-22 14:35:00 +01:00
Adding UserProfilePhotos doc and flake8 minor fixes
This commit is contained in:
parent
0b19099eea
commit
dadad120fc
3 changed files with 17 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
# flake8: noqa
|
||||
|
||||
"""A library that provides a Python interface to the Telegram Bots API"""
|
||||
|
||||
|
|
|
@ -389,6 +389,20 @@ class Bot(object):
|
|||
user_id,
|
||||
offset=None,
|
||||
limit=100):
|
||||
"""Use this method to get a list of profile pictures for a user.
|
||||
|
||||
Args:
|
||||
user_id:
|
||||
Unique identifier of the target user.
|
||||
offset:
|
||||
Sequential number of the first photo to be returned. By default,
|
||||
all photos are returned. [Optional]
|
||||
limit:
|
||||
Limits the number of photos to be retrieved. Values between 1—100
|
||||
are accepted. Defaults to 100. [Optional]
|
||||
Returns:
|
||||
Returns a telegram.UserProfilePhotos object.
|
||||
"""
|
||||
|
||||
url = '%s/getUserProfilePhotos' % (self.base_url)
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@ class UserProfilePhotos(object):
|
|||
from telegram import PhotoSize
|
||||
photos = []
|
||||
for photo in data['photos']:
|
||||
photos.append([PhotoSize.newFromJsonDict(x) for x in photo])
|
||||
photos.append([PhotoSize.newFromJsonDict(x) for x in photo])
|
||||
else:
|
||||
photos= None
|
||||
photos = None
|
||||
|
||||
return UserProfilePhotos(total_count=data.get('total_count', None),
|
||||
photos=photos)
|
||||
|
|
Loading…
Reference in a new issue