Ask coding questions

← Back to all posts
How do I fix this?
Broken7Axel

I'm making a discord bot and I don't know that much about python so here is my error msg.

File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 300, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 254, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized

Voters
Broken7Axel
Comments
hotnewtop
Coder100

confirm that the token you inputted was correct. try doing print(os.getenv('TOKEN'))

Broken7Axel

@Coder100 I did what you said and it printed my discord token back to me but I still got the error msg