File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -166,9 +166,15 @@ def timestamp(self) -> datetime.datetime:
166166 def __hash__ (self ):
167167 return hash (self ._snowflake )
168168
169- # Do we need not equals, equals, gt/lt/ge/le?
170- # If so, list them under. By Discord API this may not be needed
171- # but end users might.
169+ def __eq__ (self , other ):
170+ if isinstance (other , Snowflake ):
171+ return str (self ) == str (other )
172+ elif isinstance (other , int ):
173+ return int (self ) == other
174+ elif isinstance (other , str ):
175+ return str (self ) == other
176+
177+ return NotImplemented
172178
173179
174180class Color (object ):
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ class Snowflake(object):
4242 def __hash__ (self ) -> int : ...
4343 def __str__ (self ) -> str : ...
4444 def __int__ (self ) -> int : ...
45+ def __eq__ (self , other ) -> Union [bool , NotImplemented ]: ...
4546
4647class Format :
4748 USER : str
You can’t perform that action at this time.
0 commit comments