make user_from optional, because of channels

This commit is contained in:
Jannes Höke 2015-11-03 10:20:45 +01:00
parent 688d6af541
commit d3bea4c3b4

View file

@ -134,7 +134,7 @@ class Message(TelegramObject):
if not data:
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'])
if 'first_name' in data.get('chat', ''):
data['chat'] = User.de_json(data.get('chat'))