Skip to content

Commit 04df139

Browse files
committed
Added edit_date to Message object
As of Bot API update 2.1, `Message` object now has optional `edit_date` field.
1 parent 747f142 commit 04df139

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

telebot/types.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ def de_json(cls, json_string):
178178
opts['forward_date'] = obj['forward_date']
179179
if 'reply_to_message' in obj:
180180
opts['reply_to_message'] = Message.de_json(obj['reply_to_message'])
181+
if 'edit_date' in obj:
182+
opts['edit_date'] = Message.de_json(obj['edit_date'])
181183
if 'text' in obj:
182184
opts['text'] = obj['text']
183185
content_type = 'text'
@@ -269,6 +271,7 @@ def __init__(self, message_id, from_user, date, chat, content_type, options):
269271
self.forward_from = None
270272
self.forward_date = None
271273
self.reply_to_message = None
274+
self.edit_date = None
272275
self.text = None
273276
self.entities = None
274277
self.audio = None

0 commit comments

Comments
 (0)