aboutsummaryrefslogtreecommitdiff
path: root/discord/widget.py
diff options
context:
space:
mode:
Diffstat (limited to 'discord/widget.py')
-rw-r--r--discord/widget.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/discord/widget.py b/discord/widget.py
index 291b70ef..0fcf7ec0 100644
--- a/discord/widget.py
+++ b/discord/widget.py
@@ -29,9 +29,8 @@ from .user import BaseUser
from .activity import create_activity
from .invite import Invite
from .enums import Status, try_enum
-from collections import namedtuple
-class WidgetChannel(namedtuple('WidgetChannel', 'id name position')):
+class WidgetChannel:
"""Represents a "partial" widget channel.
.. container:: operations
@@ -61,11 +60,20 @@ class WidgetChannel(namedtuple('WidgetChannel', 'id name position')):
position: :class:`int`
The channel's position
"""
- __slots__ = ()
+ __slots__ = ('id', 'name', 'position')
+
+
+ def __init__(self, **kwargs):
+ self.id = kwargs.pop('id')
+ self.name = kwargs.pop('name')
+ self.position = kwargs.pop('position')
def __str__(self):
return self.name
+ def __repr__(self):
+ return '<WidgetChannel id={0.id} name={0.name!r} position={0.position!r}>'.format(self)
+
@property
def mention(self):
""":class:`str`: The string that allows you to mention the channel."""