From 74c95c994dac86fb2471f40ee806d0f9197b196a Mon Sep 17 00:00:00 2001 From: EvieePy <29671945+EvieePy@users.noreply.github.com> Date: Sun, 5 Jan 2025 11:41:42 +1000 Subject: [PATCH] Add eq dunder to User --- twitchio/user.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/twitchio/user.py b/twitchio/user.py index b6cc49cc..2d774be1 100644 --- a/twitchio/user.py +++ b/twitchio/user.py @@ -107,6 +107,12 @@ def __repr__(self) -> str: def __str__(self) -> str: return self.name or "..." + def __eq__(self, other: object) -> bool: + if not isinstance(other, (PartialUser, User, Chatter)): + return NotImplemented + + return self.id == other.id + @property def mention(self) -> str: """Property returning the users display_name formatted to mention them in chat.