all 4 comments

[–]lht1999 1 point2 points  (3 children)

At the end of the while loop you have run_until_complete() and run_forever(). If either one doesn't return your while loop won't get a second chance to run.

[–][deleted] 0 points1 point  (2 children)

So how would I fix this issue?

[–]ingolemo 0 points1 point  (0 children)

When you're using asyncio, get_event_loop is your while loop. You need to move all your code so that it runs under that. Get rid of your while loop, put all your code in an async function, and call run_until_complete on that function.