Skip to content

Commit

Permalink
[base_update] hash updates by their update ID
Browse files Browse the repository at this point in the history
  • Loading branch information
david-lev committed Nov 19, 2023
1 parent d3a778c commit 405b59b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pywa/types/base_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ def timestamp(self) -> dt.datetime:
def from_update(cls, client: WhatsApp, update: dict) -> BaseUpdate:
...

def __hash__(self):
"""Return the hash of the update ID."""
return hash(self.id)

def stop_handling(self) -> None:
"""
Call this method to break out of the handler loop. other handlers will not be called.
Expand Down

0 comments on commit 405b59b

Please sign in to comment.