Skip to content

Commit

Permalink
Fix user.py typings and reformat file
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapptz committed Aug 22, 2021
1 parent d17551f commit b8898c7
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions discord/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

if TYPE_CHECKING:
from datetime import datetime

from .channel import DMChannel
from .guild import Guild
from .message import Message
Expand All @@ -49,7 +49,6 @@
'ClientUser',
)

U = TypeVar('U', bound='User')
BU = TypeVar('BU', bound='BaseUser')


Expand All @@ -59,7 +58,18 @@ class _UserTag:


class BaseUser(_UserTag):
__slots__ = ('name', 'id', 'discriminator', '_avatar', '_banner', '_accent_colour', 'bot', 'system', '_public_flags', '_state')
__slots__ = (
'name',
'id',
'discriminator',
'_avatar',
'_banner',
'_accent_colour',
'bot',
'system',
'_public_flags',
'_state',
)

if TYPE_CHECKING:
name: str
Expand All @@ -68,7 +78,7 @@ class BaseUser(_UserTag):
bot: bool
system: bool
_state: ConnectionState
_avatar: str
_avatar: Optional[str]
_banner: Optional[str]
_accent_colour: Optional[str]
_public_flags: int
Expand Down Expand Up @@ -321,7 +331,7 @@ class ClientUser(BaseUser):
locale: Optional[str]
mfa_enabled: bool
_flags: int

def __init__(self, *, state: ConnectionState, data: UserPayload) -> None:
super().__init__(state=state, data=data)

Expand Down Expand Up @@ -431,7 +441,7 @@ def __del__(self) -> None:
pass

@classmethod
def _copy(cls: Type[U], user: U) -> U:
def _copy(cls, user: User):
self = super()._copy(user)
self._stored = False
return self
Expand Down

0 comments on commit b8898c7

Please sign in to comment.