Add an API to find the user that installed a bot #7389
-
Coming from https://github.com/dblock/discord-strava. My users install a bot via OAuth2 flow. I obtain a Bearer token that I actually never need to use because the bot auth now allows me to post to the guild that has just installed the bot with I cannot seem to find a way a way to find out the user ID that completed the OAuth workflow, it doesn't seem possible. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Since you got a bearer token from your OAuth2 flow you can use that on the route https://discord.com/developers/docs/resources/user#get-current-user to get data about the user. |
Beta Was this translation helpful? Give feedback.
This was likely a misunderstanding on my part.
I use the oauth flow as a trigger to create a guild record in my database, but was only asking for
bot
scope and was unnecessarily saving the bearer token.I've tried adding the
identify
scope now, which lets me also fetch the user that installed the bot viausers/@me
with the bearer token, which is what I am after. We can close this unless I'm missing something? Thanks for your help!