I'm making a dashboard for my project, the project includes a module to work with discord.js, and in this module the bot saves some data in the database, one of this is a User ID
Now, in the front-end with React + vite, working with this data, i get an obstacle...
With this ID, i want to get the user name, avatar and discriminator to show on the page, only public informations
- I read the discord API docs but i didn't find something about this, only how get self user data (
GET /users/@me), but i want to get other users public data - Watching the discord web requests, i saw the route
users/:userId/profile, this route returns what i want (name, avatar and discriminator) but when trying to get the data, i observe who the Discord doesn't accept tokens provided by Oauth (Bearer xxxxxxxx)
So, i want to know... How can i do this? I only want the name, avatar and discriminator
- I studied the possibility to save the user name when i'm saving this data in the database, but the user can only change they name and mock this
- I studied the possibility to do a anchor to redirect the user to
https://discord.com/users/:userId, but the dashboard can run in mobile too, so the user will need to login in discord with browser only to see the user? in addition to the fact that the information would not be explicit - I studied to get the members informations by the guild members, but, if the user leave or get banned / kicked of the guild?
(I'm marking all the tags because this question envolves all of them, node.js because my bot with discord.js module and api made with hyper-express, typescript because it's my language, database because the data who i'm working, and browser because of the react website, and the solution can involve any of the 4)
- I only have the bearer user token (and all oauth info)