1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Fix missing media_group_id in message.

This commit is contained in:
eternnoir 2018-01-24 19:05:38 +08:00
parent 6d180e30f0
commit afac177d7d
2 changed files with 5 additions and 0 deletions

View File

@ -274,6 +274,8 @@ class Message(JsonDeserializable):
opts['reply_to_message'] = Message.de_json(obj['reply_to_message'])
if 'edit_date' in obj:
opts['edit_date'] = obj.get('edit_date')
if 'media_group_id' in obj:
opts['media_group_id'] = obj.get('media_group_id')
if 'author_signature' in obj:
opts['author_signature'] = obj.get('author_signature')
if 'text' in obj:
@ -398,6 +400,7 @@ class Message(JsonDeserializable):
self.forward_date = None
self.reply_to_message = None
self.edit_date = None
self.media_group_id = None
self.author_signature = None
self.text = None
self.entities = None

View File

@ -418,3 +418,5 @@ class TestTeleBot:
medias = [types.InputMediaPhoto(img1, "View"), types.InputMediaPhoto(img2, "Dog")]
result = tb.send_media_group(CHAT_ID, medias)
assert len(result) == 2
assert result[0].media_group_id is not None
assert result[0].media_group_id == result[1].media_group_id