V
V
vladthez2020-11-22 21:24:18
Python
vladthez, 2020-11-22 21:24:18

Discord.py not working, what should I do?

I did everything according to the video, but I got this error:

Traceback (most recent call last):
File "C:\Users\vlad\PycharmProjects\discord-bot\venv\lib\site-packages\discord\http.py", line 291, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "C:\Users\vlad\PycharmProjects\discord-bot\venv\lib\site-packages\discord \http.py", line 245, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized

The above exception was the direct cause of the following exception:

Traceback ( most recent call last):
File "C:/Users/vlad/PycharmProjects/discord-bot/discord-bot.py", line 15, in
client.run('the token I pasted should be here')
File "C:\Users\vlad\PycharmProjects\discord-bot\venv\lib\site-packages\discord\client.py", line 708, in run
return future.result()
File "C:\Users\vlad\PycharmProjects\discord-bot\venv\lib\site-packages\discord\client.py", line 687, in runner
await self.start(*args, * *kwargs)
File "C:\Users\vlad\PycharmProjects\discord-bot\venv\lib\site-packages\discord\client.py", line 650, in start
await self.login(*args, bot=bot)
File "C:\Users\vlad\PycharmProjects\discord-bot\venv\lib\site-packages\discord\client.py", line 499, in login
await self.http.static_login(token.strip(), bot= bot)
File "C:\Users\vlad\PycharmProjects\discord-bot\venv\lib\site-packages\discord\http.py", line 295, in static_login
raise LoginFailure('Improper token has been passed.') from exc
discord .errors.LoginFailure: Improper token has been passed.
Exception ignored in:
Traceback (most recent call last):
File "F:\gnfghgfhghf\lib\asyncio\proactor_events.py", line 116, in __del__
self.close()
File "F:\gnfghgfhghf\lib\asyncio\proactor_events .py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "F:\gnfghgfhghf\lib\asyncio\base_events.py", line 711, in call_soon
self._check_closed()
File "F:\gnfghgfhghf\lib\asyncio\base_events.py", line 504, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2020-11-22
@vladthez

Either the token format is wrong, or create a new one, or where it comes from.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question