fix BotEnum comparison

This commit is contained in:
Alexander Kalinovsky
2025-02-09 23:13:39 +01:00
parent 7a4936d2ef
commit a0f21e0f1b
2 changed files with 7 additions and 4 deletions

View File

@@ -126,7 +126,10 @@ class EnumMember(object):
if isinstance(other, str):
return self.value == other
if isinstance(other, EnumMember):
return self.value == other.value and self._parent is other._parent
return self.value == other.value and (
issubclass(self._parent, other._parent)
or issubclass(other._parent, self._parent)
)
return other.__eq__(self.value)
def __hash__(self):