mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-21 22:56:38 +01:00
Fixes bug when to_data thumb for document and video
This commit is contained in:
parent
a1899a75e4
commit
185a9e9918
2 changed files with 6 additions and 4 deletions
|
@ -32,8 +32,9 @@ class Document(TelegramObject):
|
|||
file_size=data.get('file_size', None))
|
||||
|
||||
def to_dict(self):
|
||||
data = {'file_id': self.file_id,
|
||||
'thumb': self.thumb.to_dict()}
|
||||
data = {'file_id': self.file_id}
|
||||
if self.thumb:
|
||||
data['thumb'] = self.thumb.to_dict()
|
||||
if self.file_name:
|
||||
data['file_name'] = self.file_name
|
||||
if self.mime_type:
|
||||
|
|
|
@ -44,8 +44,9 @@ class Video(TelegramObject):
|
|||
data = {'file_id': self.file_id,
|
||||
'width': self.width,
|
||||
'height': self.height,
|
||||
'duration': self.duration,
|
||||
'thumb': self.thumb.to_dict()}
|
||||
'duration': self.duration}
|
||||
if self.thumb:
|
||||
data['thumb'] = self.thumb.to_dict()
|
||||
if self.mime_type:
|
||||
data['mime_type'] = self.mime_type
|
||||
if self.file_size:
|
||||
|
|
Loading…
Reference in a new issue