mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-29 19:52:44 +01:00
make user_from optional, because of channels
This commit is contained in:
parent
54efb034a4
commit
a6c12adda2
1 changed files with 1 additions and 1 deletions
|
@ -134,7 +134,7 @@ class Message(TelegramObject):
|
||||||
if not data:
|
if not data:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
data['from_user'] = User.de_json(data['from'])
|
data['from_user'] = User.de_json(data.get('from'))
|
||||||
data['date'] = datetime.fromtimestamp(data['date'])
|
data['date'] = datetime.fromtimestamp(data['date'])
|
||||||
if 'first_name' in data.get('chat', ''):
|
if 'first_name' in data.get('chat', ''):
|
||||||
data['chat'] = User.de_json(data.get('chat'))
|
data['chat'] = User.de_json(data.get('chat'))
|
||||||
|
|
Loading…
Reference in a new issue