diff --git a/khl/bot/bot.py b/khl/bot/bot.py index cc76b1d2..fe30c739 100644 --- a/khl/bot/bot.py +++ b/khl/bot/bot.py @@ -488,7 +488,11 @@ async def start(self): def run(self): """run the bot in blocking mode""" if not self.loop: - self.loop = asyncio.get_event_loop() + try: + self.loop = asyncio.get_event_loop() + except RuntimeError: + self.loop = asyncio.new_event_loop() + asyncio.set_event_loop(self.loop) try: self.loop.run_until_complete(self.start()) except KeyboardInterrupt: