aboutsummaryrefslogtreecommitdiff
path: root/discord/role.py
diff options
context:
space:
mode:
Diffstat (limited to 'discord/role.py')
-rw-r--r--discord/role.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/discord/role.py b/discord/role.py
index 760a0bce..93d8e3b5 100644
--- a/discord/role.py
+++ b/discord/role.py
@@ -26,10 +26,23 @@ DEALINGS IN THE SOFTWARE.
from .permissions import Permissions
from .colour import Colour
+from .mixins import EqualityComparable
-class Role(object):
+class Role(EqualityComparable):
"""Represents a Discord role in a :class:`Server`.
+ Supported Operations:
+
+ +-----------+------------------------------------+
+ | Operation | Description |
+ +===========+====================================+
+ | x == y | Checks if two roles are equal. |
+ +-----------+------------------------------------+
+ | x != y | Checks if two roles are not equal. |
+ +-----------+------------------------------------+
+ | str(x) | Returns the role's name. |
+ +-----------+------------------------------------+
+
Attributes
----------
id : str
@@ -53,6 +66,9 @@ class Role(object):
self._is_everyone = kwargs.get('everyone', False)
self.update(**kwargs)
+ def __str__(self):
+ return self.name
+
def update(self, **kwargs):
self.id = kwargs.get('id')
self.name = kwargs.get('name')