From 679d03897951eaeb0de6ae45894bbe08ad204c5a Mon Sep 17 00:00:00 2001 From: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com> Date: Thu, 2 Jan 2025 09:17:01 +0100 Subject: [PATCH] Ensure Forward Compatibility of `Gift` and `Gifts` (#4634) --- telegram/_gifts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telegram/_gifts.py b/telegram/_gifts.py index fa26eacb77a..4d4ab4eb112 100644 --- a/telegram/_gifts.py +++ b/telegram/_gifts.py @@ -90,7 +90,7 @@ def de_json(cls, data: Optional[JSONDict], bot: Optional["Bot"] = None) -> Optio return None data["sticker"] = Sticker.de_json(data.get("sticker"), bot) - return cls(**data) + return super().de_json(data=data, bot=bot) class Gifts(TelegramObject): @@ -133,4 +133,4 @@ def de_json(cls, data: Optional[JSONDict], bot: Optional["Bot"] = None) -> Optio return None data["gifts"] = Gift.de_list(data.get("gifts"), bot) - return cls(**data) + return super().de_json(data=data, bot=bot)