#async_init was never awaited

1 messages · Page 1 of 1 (latest)

granite houndBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

lime salmon
#

The cleanest thing to do would be to run this code after you listen to the Startup event

lime salmon
#

you listen to the Startup event directly in your cog

#

and when the event is fired, you can initialize all your class variables

frigid idol
#

right?

lime salmon
#

startup is fired once

#

but you can have multiple listeners to it

#

one in main file, one in a cog, etc...

frigid idol
#

im still confused why the code is giving that error tho

#

thats what the example shows

frigid idol
lime salmon
#

because that's not how to use create_task apparently

#

use asyncio.run() instead

frigid idol
#

so that page of the docs is outdated?

lime salmon
#

recommended way to do it

frigid idol
#

but thats entirely diff than init

#

2 diff purposes right?

lime salmon
frigid idol
#

so confirming that bit is outdated?

lime salmon
#

idk

#

have you read the warning just below create_task?

frigid idol
#

oh shit

#

in my defense i was really tired but still coding yesterday 😅