From d919c89371e6f131a118d036fa944e1ed488d470 Mon Sep 17 00:00:00 2001 From: David Lev Date: Thu, 26 Oct 2023 22:19:43 +0300 Subject: [PATCH] [reaction] treat removed emoji as `None` (and not empty str) --- pywa/types/others.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pywa/types/others.py b/pywa/types/others.py index 823389cd..76e46b85 100644 --- a/pywa/types/others.py +++ b/pywa/types/others.py @@ -101,6 +101,10 @@ class Reaction(utils.FromDict): message_id: str emoji: str | None = None + @classmethod + def from_dict(cls, data: dict, **kwargs) -> Reaction: + return cls(message_id=data["message_id"], emoji=data["emoji"] or None) + @dataclasses.dataclass(frozen=True, slots=True) class Location(utils.FromDict):