aboutsummaryrefslogtreecommitdiff
path: root/discord/channel.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-12-17 00:30:08 -0500
committerRapptz <[email protected]>2015-12-17 00:32:54 -0500
commit51d91c2a82e01275d1c1d888319f1db14dc11791 (patch)
tree80aeac8f9a7d2c9be21e775c9185bec34cb10756 /discord/channel.py
parentAdd Message.clean_content property to get prettified mentions. (diff)
downloaddiscord.py-51d91c2a82e01275d1c1d888319f1db14dc11791.tar.xz
discord.py-51d91c2a82e01275d1c1d888319f1db14dc11791.zip
Most data classes now support hashing.
Diffstat (limited to 'discord/channel.py')
-rw-r--r--discord/channel.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/discord/channel.py b/discord/channel.py
index 983b4fb9..5f53b837 100644
--- a/discord/channel.py
+++ b/discord/channel.py
@@ -28,11 +28,11 @@ from . import utils
from .permissions import Permissions
from .enums import ChannelType
from collections import namedtuple
-from .mixins import EqualityComparable
+from .mixins import Hashable
Overwrites = namedtuple('Overwrites', 'id allow deny type')
-class Channel(EqualityComparable):
+class Channel(Hashable):
"""Represents a Discord server channel.
Supported Operations:
@@ -44,6 +44,8 @@ class Channel(EqualityComparable):
+-----------+---------------------------------------+
| x != y | Checks if two channels are not equal. |
+-----------+---------------------------------------+
+ | hash(x) | Returns the channel's hash. |
+ +-----------+---------------------------------------+
| str(x) | Returns the channel's name. |
+-----------+---------------------------------------+
@@ -196,7 +198,7 @@ class Channel(EqualityComparable):
return base
-class PrivateChannel(EqualityComparable):
+class PrivateChannel(Hashable):
"""Represents a Discord private channel.
Supported Operations:
@@ -208,6 +210,8 @@ class PrivateChannel(EqualityComparable):
+-----------+-------------------------------------------------+
| x != y | Checks if two channels are not equal. |
+-----------+-------------------------------------------------+
+ | hash(x) | Returns the channel's hash. |
+ +-----------+-------------------------------------------------+
| str(x) | Returns the string "Direct Message with <User>" |
+-----------+-------------------------------------------------+