Browse Source

Add __bool__ for flags

pull/10109/head
Rapptz 3 years ago
committed by dolfies
parent
commit
cd187648e1
  1. 3
      discord/flags.py

3
discord/flags.py

@ -159,6 +159,9 @@ class BaseFlags:
max_value = -1 + (2**max_bits)
return self._from_value(self.value ^ max_value)
def __bool__(self) -> bool:
return self.value != self.DEFAULT_VALUE
def __eq__(self, other: object) -> bool:
return isinstance(other, self.__class__) and self.value == other.value

Loading…
Cancel
Save