From b1e600a358423951841e36895bd013034c500b28 Mon Sep 17 00:00:00 2001 From: Mikhail Polykovskii Date: Mon, 16 Feb 2026 20:36:00 +0300 Subject: [PATCH] Implement de_json method in UniqueGiftColors --- telebot/types.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/telebot/types.py b/telebot/types.py index 73dba2015..272e19e94 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -13123,6 +13123,14 @@ def __init__(self, model_custom_emoji_id: str, symbol_custom_emoji_id: str, self.light_theme_other_colors: List[int] = light_theme_other_colors self.dark_theme_main_color: int = dark_theme_main_color self.dark_theme_other_colors: List[int] = dark_theme_other_colors + + @classmethod + def de_json(cls, json_string): + if json_string is None: return None + obj = cls.check_json(json_string) + return cls(**obj) + + class DirectMessagesTopic(JsonDeserializable): """ Describes a topic of a direct messages chat. @@ -13467,5 +13475,3 @@ def de_json(cls, json_string): if json_string is None: return None obj = cls.check_json(json_string) return cls(**obj) - - \ No newline at end of file