discord.py: Bot automaticly stops after a few minutes.

I have an (almost) perfectly working bot, the only problem was that it closes after a few minutes. I tried to fix it by replacing client.run(TOKEN) with while True: client.run(TOKEN) but that didn’t work because now I keep getting the error: Traceback (most recent call last): File "C:\Users\kiron\Desktop\AI\Discord.py", line 11, in <module> api.discord.run(TOKEN) File "C:\Users\kiron\Desktop\AI\api\discord.py", line 57, in run client.run(TOKEN) File "C:\Users\kiron\AppData\Local\Programs\Python\Python35-32\lib\site-packages\discord\client.py", line 519, in run self.loop.run_until_complete(self.start(*args, **kwargs)) File "C:\Users\kiron\AppData\Local\Programs\Python\Python35-32\lib\asyncio\base_events.py", line 364, in run_until_complete self._check_closed() File "C:\Users\kiron\AppData\Local\Programs\Python\Python35-32\lib\asyncio\base_events.py", line 334, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed

Somebody know how to fix this?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 23 (7 by maintainers)

Most upvoted comments

ravi2005