diff options
| author | Tarek <[email protected]> | 2020-09-21 09:36:58 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-09-21 03:36:58 -0400 |
| commit | 7f17dc79a6e2dece4a8e37b8c3ac18bfe3b1d49d (patch) | |
| tree | 87c85d078110d4c0c8a8937f0f6a6637fb169273 /discord/integrations.py | |
| parent | Add bot.listen() suggestion to on_message faq (diff) | |
| download | discord.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.py | 9 |
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) |