@@ -8889,6 +8889,10 @@ def de_json(cls, json_string):
8889
8889
obj['poll'] = Poll.de_json(obj['poll'])
8890
8890
if 'venue' in obj:
8891
8891
obj['venue'] = Venue.de_json(obj['venue'])
8892
+ if 'paid_media' in obj:
8893
+ obj['paid_media'] = PaidMediaInfo.de_json(obj['paid_media'])
8894
+ if 'checklist' in obj:
8895
+ obj['checklist'] = Checklist.de_json(obj['checklist'])
8892
8896
return cls(**obj)
8893
8897
8894
8898
def __init__(
@@ -12523,7 +12527,7 @@ def de_json(cls, json_string):
12523
12527
if json_string is None: return None
12524
12528
obj = cls.check_json(json_string)
12525
12529
if 'text_entities' in obj:
12526
- obj['text_entities'] = [MessageEntity.de_json(entity) for entity in obj['text_entities']]
12530
+ obj['text_entities'] = Message.parse_entities( obj['text_entities'])
12527
12531
if 'completed_by_user' in obj:
12528
12532
obj['completed_by_user'] = User.de_json(obj['completed_by_user'])
12529
12533
return cls(**obj)
@@ -12552,8 +12556,8 @@ class Checklist(JsonDeserializable):
12552
12556
:return: Instance of the class
12553
12557
:rtype: :class:`Checklist`
12554
12558
"""
12555
- def __init__(self, title: str, tasks: List[ChecklistTask],
12556
- title_entities: Optional[ List[MessageEntity] ] = None,
12559
+ def __init__(self, title: str,title_entities: Optional[ List[MessageEntity]] = None,
12560
+ tasks: List[ChecklistTask ] = None,
12557
12561
others_can_add_tasks: Optional[bool] = None,
12558
12562
others_can_mark_tasks_as_done: Optional[bool] = None, **kwargs):
12559
12563
self.title: str = title
@@ -12567,7 +12571,7 @@ def de_json(cls, json_string):
12567
12571
if json_string is None: return None
12568
12572
obj = cls.check_json(json_string)
12569
12573
if 'title_entities' in obj:
12570
- obj['title_entities'] = [MessageEntity.de_json(entity) for entity in obj['title_entities']]
12574
+ obj['title_entities'] = Message.parse_entities( obj['title_entities'])
12571
12575
if 'tasks' in obj:
12572
12576
obj['tasks'] = [ChecklistTask.de_json(task) for task in obj['tasks']]
12573
12577
return cls(**obj)
@@ -12608,9 +12612,9 @@ def to_dict(self):
12608
12612
'id': self.id,
12609
12613
'text': self.text
12610
12614
}
12611
- if self.parse_mode is not None :
12615
+ if self.parse_mode:
12612
12616
data['parse_mode'] = self.parse_mode
12613
- if self.text_entities is not None :
12617
+ if self.text_entities:
12614
12618
data['text_entities'] = [entity.to_dict() for entity in self.text_entities]
12615
12619
return data
12616
12620
@@ -12641,10 +12645,9 @@ class InputChecklist(JsonSerializable):
12641
12645
:return: Instance of the class
12642
12646
:rtype: :class:`InputChecklist`
12643
12647
"""
12644
- def __init__(self, title: str, tasks: List[InputChecklistTask],
12645
- parse_mode: Optional[str] = None,
12648
+ def __init__(self, title: str,parse_mode: Optional[str] = None,
12646
12649
title_entities: Optional[List[MessageEntity]] = None,
12647
- others_can_add_tasks: Optional[bool] = None,
12650
+ tasks: List[InputChecklistTask], others_can_add_tasks: Optional[bool] = None,
12648
12651
others_can_mark_tasks_as_done: Optional[bool] = None, **kwargs):
12649
12652
self.title: str = title
12650
12653
self.parse_mode: Optional[str] = parse_mode
@@ -12661,9 +12664,9 @@ def to_dict(self):
12661
12664
'title': self.title,
12662
12665
'tasks': [task.to_dict() for task in self.tasks]
12663
12666
}
12664
- if self.parse_mode is not None :
12667
+ if self.parse_mode:
12665
12668
data['parse_mode'] = self.parse_mode
12666
- if self.title_entities is not None :
12669
+ if self.title_entities:
12667
12670
data['title_entities'] = [entity.to_dict() for entity in self.title_entities]
12668
12671
if self.others_can_add_tasks is not None:
12669
12672
data['others_can_add_tasks'] = self.others_can_add_tasks
0 commit comments