mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Fix CallbackQuery issue for games
This commit is contained in:
parent
fcf4d91564
commit
6fb10e92e4
@ -1160,6 +1160,9 @@ class CallbackQuery(JsonDeserializable):
|
||||
def de_json(cls, json_string):
|
||||
if json_string is None: return None
|
||||
obj = cls.check_json(json_string)
|
||||
if not "data" in obj:
|
||||
# "data" field is Optional in the API, but historically is mandatory in the class constructor
|
||||
obj['data'] = None
|
||||
obj['from_user'] = User.de_json(obj.pop('from'))
|
||||
if 'message' in obj:
|
||||
obj['message'] = Message.de_json(obj.get('message'))
|
||||
|
Loading…
Reference in New Issue
Block a user