Make discord.Object hashable.
This commit is contained in:
parent
ecdd21212c
commit
f554861e68
@ -24,8 +24,9 @@ DEALINGS IN THE SOFTWARE.
|
||||
"""
|
||||
|
||||
from . import utils
|
||||
from .mixins import Hashable
|
||||
|
||||
class Object:
|
||||
class Object(Hashable):
|
||||
"""Represents a generic Discord object.
|
||||
|
||||
The purpose of this class is to allow you to create 'miniature'
|
||||
@ -39,6 +40,20 @@ class Object:
|
||||
receive this class rather than the actual data class. These cases are
|
||||
extremely rare.
|
||||
|
||||
.. container:: operations
|
||||
|
||||
.. describe:: x == y
|
||||
|
||||
Checks if two objects are equal.
|
||||
|
||||
.. describe:: x != y
|
||||
|
||||
Checks if two objects are not equal.
|
||||
|
||||
.. describe:: hash(x)
|
||||
|
||||
Returns the object's hash.
|
||||
|
||||
Attributes
|
||||
-----------
|
||||
id : str
|
||||
|
Loading…
x
Reference in New Issue
Block a user