Skip to content

Commit 0d4d1b8

Browse files
authored
Implement de_json method in types.py
Add de_json class method for deserializing JSON.
1 parent bc4374f commit 0d4d1b8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

telebot/types.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13123,6 +13123,14 @@ def __init__(self, model_custom_emoji_id: str, symbol_custom_emoji_id: str,
1312313123
self.light_theme_other_colors: List[int] = light_theme_other_colors
1312413124
self.dark_theme_main_color: int = dark_theme_main_color
1312513125
self.dark_theme_other_colors: List[int] = dark_theme_other_colors
13126+
13127+
@classmethod
13128+
def de_json(cls, json_string):
13129+
if json_string is None: return None
13130+
obj = cls.check_json(json_string)
13131+
return cls(**obj)
13132+
13133+
1312613134
class DirectMessagesTopic(JsonDeserializable):
1312713135
"""
1312813136
Describes a topic of a direct messages chat.
@@ -13468,4 +13476,4 @@ def de_json(cls, json_string):
1346813476
obj = cls.check_json(json_string)
1346913477
return cls(**obj)
1347013478

13471-
13479+

0 commit comments

Comments
 (0)