I am using Quart and Discord.py to build a discord bot. i run the two with this method.
app.app_context()
bot.loop.create_task(app.run_task(host="0.0.0.0", port=80))
bot.run(Discord_Dev_Token)
i tried to deploy the project into heroku service and it makes a successful deployement but it doesn't work later when i check the logs i find this error message
2022-09-10T22:08:17.191305+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
2022-09-10T22:08:17.191350+00:00 app[web.1]: File "/app/mvc.py", line 688, in <module>
2022-09-10T22:08:17.191694+00:00 app[web.1]: bot.loop.create_task(app.run_task(host="0.0.0.0", port=PORT))
2022-09-10T22:08:17.191707+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/discord/client.py", line 108, in __getattr__
2022-09-10T22:08:17.191797+00:00 app[web.1]: raise AttributeError(msg)
2022-09-10T22:08:17.191827+00:00 app[web.1]: AttributeError: loop attribute cannot be accessed in non-async contexts. Consider using either an asynchronous main function and passing it to asyncio.run or using asynchronous initialisation hooks such as Client.setup_hook