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
d.js toolkit
d.js toolkit5mo ago
- 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!
jimi
jimi5mo ago
help me out pls
duck
duck5mo ago
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-servers
jimi
jimi5mo ago
tysm
jimi
jimi5mo ago
u mean like this?
No description
duck
duck5mo ago
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#authPrefix
jimi
jimi5mo ago
ohh ok got it