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 toolkit12mo 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
jimiOP12mo ago
help me out pls
duck
duck12mo 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
jimiOP12mo ago
tysm
jimi
jimiOP12mo ago
u mean like this?
No description
duck
duck12mo 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
jimiOP12mo ago
ohh ok got it
Want results from more Discord servers?
Add your server