diff options
| author | Rapptz <[email protected]> | 2019-07-09 22:49:34 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-07-09 22:51:49 -0400 |
| commit | e75c248a9a41e14639dc4c032cea47867c886ec0 (patch) | |
| tree | 2278478a0083d3b03a6497bda1fa932afe8db90b | |
| parent | [commands] Don't update sys.modules with a stale reference. (diff) | |
| download | discord.py-e75c248a9a41e14639dc4c032cea47867c886ec0.tar.xz discord.py-e75c248a9a41e14639dc4c032cea47867c886ec0.zip | |
Properly populate __slots__ for derived user types.
Fixes #2265
| -rw-r--r-- | discord/user.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/discord/user.py b/discord/user.py index 0b5fcb0d..b567913f 100644 --- a/discord/user.py +++ b/discord/user.py @@ -294,7 +294,8 @@ class ClientUser(BaseUser): premium_type: :class:`PremiumType` Specifies the type of premium a user has (e.g. Nitro or Nitro Classic). Could be None if the user is not premium. """ - __slots__ = ('email', 'locale', '_flags', 'verified', 'mfa_enabled', + __slots__ = BaseUser.__slots__ + \ + ('email', 'locale', '_flags', 'verified', 'mfa_enabled', 'premium', 'premium_type', '_relationships', '__weakref__') def __init__(self, *, state, data): @@ -650,7 +651,7 @@ class User(BaseUser, discord.abc.Messageable): Specifies if the user is a bot account. """ - __slots__ = ('__weakref__',) + __slots__ = BaseUser.__slots__ + ('__weakref__',) def __repr__(self): return '<User id={0.id} name={0.name!r} discriminator={0.discriminator!r} bot={0.bot}>'.format(self) |