DiscordAPIError[0]: 401: Unauthorized even though im authorized and the access token is brand new?
I want to get user's @me info with access token, but it says im unauthorized?
8 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
Yes
yeah

theres no reason for it to throw 401
i console log it right before running rest

and it logs a valid token
do u know what i could do to fix this
yeah now i know what's wrong, the authorization header begins with the bot prefix instead of bearer
even tho i set it to bearer
0.4.1
i installed it today? i didnt add any version parameter i just ran
npm i @discordjs/rest
so i thought its gonna install @latest
just updated it to 2.3.0 and it still uses bot instead of bearer
ohh nvm it works now
thanks a lot