mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-12-02 13:06:51 +01:00
22 lines
617 B
Python
22 lines
617 B
Python
#!/usr/bin/env python
|
|
|
|
|
|
class UserProfilePhotos(object):
|
|
def __init__(self,
|
|
total_count,
|
|
photos):
|
|
self.total_count = total_count
|
|
self.photos = photos
|
|
|
|
@staticmethod
|
|
def de_json(data):
|
|
if 'photos' in data:
|
|
from telegram import PhotoSize
|
|
photos = []
|
|
for photo in data['photos']:
|
|
photos.append([PhotoSize.de_json(x) for x in photo])
|
|
else:
|
|
photos = None
|
|
|
|
return UserProfilePhotos(total_count=data.get('total_count', None),
|
|
photos=photos)
|