Skip to content

Commit 405b59b

Browse files
committed
[base_update] hash updates by their update ID
1 parent d3a778c commit 405b59b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pywa/types/base_update.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ def timestamp(self) -> dt.datetime:
6868
def from_update(cls, client: WhatsApp, update: dict) -> BaseUpdate:
6969
...
7070

71+
def __hash__(self):
72+
"""Return the hash of the update ID."""
73+
return hash(self.id)
74+
7175
def stop_handling(self) -> None:
7276
"""
7377
Call this method to break out of the handler loop. other handlers will not be called.

0 commit comments

Comments
 (0)