Skip to content

Commit

Permalink
Added the field has_protected_content to the classes Chat and Message.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mustafa Asaad committed Mar 8, 2022
1 parent 532a400 commit eb62102
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tgbotapi/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def de_json(cls, obj_type):
bio = None
if 'bio' in obj:
bio = obj['bio']
has_private_forwards = None
has_private_forwards = False
if 'has_private_forwards' in obj:
has_private_forwards = obj['has_private_forwards']
description = None
Expand All @@ -239,7 +239,7 @@ def de_json(cls, obj_type):
message_auto_delete_time = None
if 'message_auto_delete_time' in obj:
message_auto_delete_time = obj['message_auto_delete_time']
has_protected_content = None
has_protected_content = False
if 'has_protected_content' in obj:
has_protected_content = obj['has_protected_content']
sticker_set_name = None
Expand Down Expand Up @@ -275,6 +275,7 @@ def __init__(self, message_id, from_user, sender_chat, date, chat, options):
self.forward_date = None
self.reply_to_message = None
self.via_bot = None
self.has_protected_content = False
self.edit_date = None
self.media_group_id = None
self.author_signature = None
Expand Down Expand Up @@ -348,6 +349,8 @@ def de_json(cls, obj_type):
opts['via_bot'] = User.de_json(obj['via_bot'])
if 'edit_date' in obj:
opts['edit_date'] = obj['edit_date']
if 'has_protected_content' in obj:
opts['has_protected_content'] = obj['has_protected_content']
if 'media_group_id' in obj:
opts['media_group_id'] = obj['media_group_id']
if 'author_signature' in obj:
Expand Down

0 comments on commit eb62102

Please sign in to comment.