Error when I use tree.sync() #7766
-
I have an error using tree.sync(). I can't fix it. I upgraded asyncio and aiohttp, but it doesn't fix. Maybe you can solve this problem.
Code, where I use async def main():
async with bot:
await bot.tree.sync(guild=discord.Object(892493256129118260))
await load_extensions()
if settings["isBetaVersion"] is not True:
await bot.start(settings['token'])
else:
await bot.start(beta_settings['beta_token']) Also code, where |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Could you edit the issue to not include a whole file. We can tell its from |
Beta Was this translation helpful? Give feedback.
-
async def static_login(self, token: str) -> user.User:
# Necessary to get aiohttp to stop complaining about session creation
if ...:
self.connector = aiohttp.TCPConnector(...)
self.__session = aiohttp.ClientSession(
...
)
self._global_over = asyncio.Event() # this line! as seen in this line, _global_over is only defined after you login. All you need to do is to run your bot first. |
Beta Was this translation helpful? Give feedback.
http.py#L550
as seen in this line, _global_over is only defined after you login.
It will be
MISSING
before logging in, aka '_MissingSential'. (http.py#L340)All you need to do is to run your bot first.