Browse Source

Typecase id value to bool

in the case where id is Unset this will call the builtin
__bool__ which returns False. This is not ideal beacuse
an Id of 0 will mean the emoji is custom, but to fix would
require a deeper refactor of the Field logic. Lets put a pin
in it.
pull/60/head
Kodie 8 years ago
parent
commit
2f77c36dfd
  1. 2
      disco/types/message.py

2
disco/types/message.py

@ -43,7 +43,7 @@ class Emoji(SlottedModel):
@cached_property
def custom(self):
return not isinstance(self.id, Unset)
return bool(self.id)
def __eq__(self, other):
if isinstance(other, Emoji):

Loading…
Cancel
Save