How do i get user's guilds with @discordjs/rest
I got the access token and i want to fetch user's guilds
7 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!help me out pls
you can import
Routes
from discord-api-types/v10
to make a get
request to Routes.userGuilds()
you can specify the authPrefix
option when constructing the REST
client or in the request options
beyond this, further questions about oauth will likely be better suited to ddevs #useful-serverstysm
u mean like this?
no, the token is still set the same way you'd set a bot token with
<REST>.setToken()
the authPrefix
is for specifying that this is a Bearer
token
https://discord.js.org/docs/packages/rest/main/RESTOptions:Interface#authPrefixohh ok got it