diff options
| author | Gnome! <[email protected]> | 2021-08-10 13:37:29 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-08-10 08:37:29 -0400 |
| commit | 4fca699810e3335928f1c56a92e345a9ce6b4f64 (patch) | |
| tree | 3bf37f4d89da5d230a69eec7a0069c6f12f7910e /discord/client.py | |
| parent | [types] Add Application Command Type payloads (diff) | |
| download | discord.py-4fca699810e3335928f1c56a92e345a9ce6b4f64.tar.xz discord.py-4fca699810e3335928f1c56a92e345a9ce6b4f64.zip | |
Fill in ConnectionState.user via HTTPClient.static_login
Diffstat (limited to 'discord/client.py')
| -rw-r--r-- | discord/client.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/discord/client.py b/discord/client.py index c629b3c9..81c86d7f 100644 --- a/discord/client.py +++ b/discord/client.py @@ -33,7 +33,7 @@ from typing import Any, Callable, Coroutine, Dict, Generator, Iterable, List, Op import aiohttp -from .user import User +from .user import User, ClientUser from .invite import Invite from .template import Template from .widget import Widget @@ -65,7 +65,6 @@ from .sticker import GuildSticker, StandardSticker, StickerPack, _sticker_factor if TYPE_CHECKING: from .abc import SnowflakeTime, PrivateChannel, GuildChannel, Snowflake from .channel import DMChannel - from .user import ClientUser from .message import Message from .member import Member from .voice_client import VoiceProtocol @@ -467,7 +466,9 @@ class Client: """ log.info('logging in using static token') - await self.http.static_login(token.strip()) + + data = await self.http.static_login(token.strip()) + self._connection.user = ClientUser(state=self._connection, data=data) async def connect(self, *, reconnect: bool = True) -> None: """|coro| |