aboutsummaryrefslogtreecommitdiff
path: root/discord/integrations.py
diff options
context:
space:
mode:
authorTarek <[email protected]>2020-09-21 09:36:58 +0200
committerGitHub <[email protected]>2020-09-21 03:36:58 -0400
commit7f17dc79a6e2dece4a8e37b8c3ac18bfe3b1d49d (patch)
tree87c85d078110d4c0c8a8937f0f6a6637fb169273 /discord/integrations.py
parentAdd bot.listen() suggestion to on_message faq (diff)
downloaddiscord.py-7f17dc79a6e2dece4a8e37b8c3ac18bfe3b1d49d.tar.xz
discord.py-7f17dc79a6e2dece4a8e37b8c3ac18bfe3b1d49d.zip
Remove namedtuples to better future guard the library
Diffstat (limited to 'discord/integrations.py')
-rw-r--r--discord/integrations.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/discord/integrations.py b/discord/integrations.py
index 91b39d0d..37fda5e9 100644
--- a/discord/integrations.py
+++ b/discord/integrations.py
@@ -25,13 +25,12 @@ DEALINGS IN THE SOFTWARE.
"""
import datetime
-from collections import namedtuple
from .utils import _get_as_snowflake, get, parse_time
from .user import User
from .errors import InvalidArgument
from .enums import try_enum, ExpireBehaviour
-class IntegrationAccount(namedtuple('IntegrationAccount', 'id name')):
+class IntegrationAccount:
"""Represents an integration account.
.. versionadded:: 1.4
@@ -44,7 +43,11 @@ class IntegrationAccount(namedtuple('IntegrationAccount', 'id name')):
The account name.
"""
- __slots__ = ()
+ __slots__ = ('id', 'name')
+
+ def __init__(self, **kwargs):
+ self.id = kwargs.pop('id')
+ self.name = kwargs.pop('name')
def __repr__(self):
return '<IntegrationAccount id={0.id} name={0.name!r}>'.format(self)