Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature-changes20160522' into ap…
Browse files Browse the repository at this point in the history
…i2.1
  • Loading branch information
eternnoir committed Jun 7, 2016
2 parents 8e3c9d8 + 8c20f63 commit d701fd6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions telebot/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def __init__(self, update_id, message, edited_message, inline_query, chosen_inli
self.update_id = update_id
self.edited_message = edited_message
self.message = message
self.edited_message = edited_message
self.inline_query = inline_query
self.chosen_inline_result = chosen_inline_result
self.callback_query = callback_query
Expand Down Expand Up @@ -187,6 +188,8 @@ def de_json(cls, json_string):
opts['forward_date'] = obj['forward_date']
if 'reply_to_message' in obj:
opts['reply_to_message'] = Message.de_json(obj['reply_to_message'])
if 'edit_date' in obj:
opts['edit_date'] = obj.get('edit_date')
if 'text' in obj:
opts['text'] = obj['text']
content_type = 'text'
Expand Down Expand Up @@ -278,6 +281,7 @@ def __init__(self, message_id, from_user, date, chat, content_type, options):
self.forward_from = None
self.forward_date = None
self.reply_to_message = None
self.edit_date = None
self.text = None
self.entities = None
self.audio = None
Expand Down Expand Up @@ -313,13 +317,17 @@ def de_json(cls, json_string):
offset = obj['offset']
length = obj['length']
url = obj.get('url')
return cls(type, offset, length, url)
user = None
if 'user' in obj:
user = User.de_json(obj['user'])
return cls(type, offset, length, url, user)

def __init__(self, type, offset, length, url=None):
def __init__(self, type, offset, length, url=None, user=None):
self.type = type
self.offset = offset
self.length = length
self.url = url
self.user = user


class PhotoSize(JsonDeserializable):
Expand Down

0 comments on commit d701fd6

Please sign in to comment.