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

Update types.py

Animation is moved before document to save backward compatibility. content_type = 'document' should override content_type = 'animation' to save previous behaviour.
This commit is contained in:
Badiboy 2020-01-03 17:51:05 +03:00 committed by GitHub
parent 8f8276314e
commit 0603a0df4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -287,6 +287,9 @@ class Message(JsonDeserializable):
if 'audio' in obj:
opts['audio'] = Audio.de_json(obj['audio'])
content_type = 'audio'
if 'animation' in obj:
opts['animation'] = Animation.de_json(obj['animation'])
content_type = 'animation'
if 'document' in obj:
opts['document'] = Document.de_json(obj['document'])
content_type = 'document'
@ -296,9 +299,6 @@ class Message(JsonDeserializable):
if 'photo' in obj:
opts['photo'] = Message.parse_photo(obj['photo'])
content_type = 'photo'
if 'animation' in obj:
opts['animation'] = Animation.de_json(obj['animation'])
content_type = 'animation'
if 'sticker' in obj:
opts['sticker'] = Sticker.de_json(obj['sticker'])
content_type = 'sticker'