Answers for "event loop is closed discord.py"

1

discord.py runtimeerror: event loop is closed

File "C:\Users\---\AppData\Local\Programs\Python\Python38-32\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\---\AppData\Local\Programs\Python\Python38-32\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\---\AppData\Local\Programs\Python\Python38-32\lib\asyncio\base_events.py", line 719, in call_soon
    self._check_closed()
  File "C:\Users\---\AppData\Local\Programs\Python\Python38-32\lib\asyncio\base_events.py", line 508, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
[Finished in 0.871s]
Posted by: Guest on June-11-2021
0

event loop is closed discord.py

You need to go your your Development Panel of the Discord Bot, click on the Bot tab, and there you will find a TOKEN, it says Reveal Token, you just need to click COPY.

Then, on your code you need to establish that token like this.

import discord
from discord.ext import commands

TOKEN = "here paste your token"

client=commands.Bot(command_prefix = '.')

@client.event
async def on_ready():
    print('Connected')

client.run(TOKEN)
This will fix your problem, Enjoy coding!
Posted by: Guest on March-02-2021

Browse Popular Code Answers by Language