Skip to content

Commit

Permalink
[reaction] treat removed emoji as None (and not empty str)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-lev committed Oct 26, 2023
1 parent dd90e86 commit d919c89
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pywa/types/others.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit d919c89

Please sign in to comment.