Skip to content

Commit 4bef69c

Browse files
authored
refactor: move getting bot info to _ready (#1055)
1 parent 4d932c1 commit 4bef69c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

interactions/client/bot.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,6 @@ def latency(self) -> float:
125125
def start(self) -> None:
126126
"""Starts the client session."""
127127

128-
if isinstance(self._http, str):
129-
self._http = HTTPClient(self._http)
130-
131-
data = self._loop.run_until_complete(self._http.get_current_bot_information())
132-
self.me = Application(**data, _client=self._http)
133-
134128
try:
135129
self._loop.run_until_complete(self._ready())
136130
except (CancelledError, Exception) as e:
@@ -358,6 +352,12 @@ async def _ready(self) -> None:
358352
"""
359353
ready: bool = False
360354

355+
if isinstance(self._http, str):
356+
self._http = HTTPClient(self._http)
357+
358+
data = await self._http.get_current_bot_information()
359+
self.me = Application(**data, _client=self._http)
360+
361361
try:
362362
if self.me.flags is not None:
363363
# This can be None.

0 commit comments

Comments
 (0)