timoniq / telegrinder

Modern visionary telegram bot framework
MIT License
31 stars 5 forks source link

fix: warning 'coroutine was never awaited' #96

Closed luwqz1 closed 2 months ago

luwqz1 commented 2 months ago

✏️ Description ✏️

After the program exits warning messages appear: coroutine 'coro_name' was never awaited. The reason for this bug is the function 'to_coroutine_task'.

🪄 Code example 🪄

from telegrinder import LoopWrapper

async def create_tables() -> None:
    ...

lw = LoopWrapper()
lw.lifespan.on_startup(create_tables())
lw.run_event_loop()

📝 Logs 📝

RuntimeWarning: coroutine 'create_tables' was never awaited

.