OAuth2Discord
OAuth2Discord copied to clipboard
Get user role in Discord server.
So I don't understand the readme that well, so I'm just gonna ask for plain help right out. How do I make it so that the user can just connect to their Discord Account using my Java application (press button event) and it will check if they have a specified Discord role in my server?
You won't be able to get the server roles of a member with this library alone.
I could imagine a workflow like this for your problem:
Prerequisites: A Discord Bot that is part of the server that you want to check the member roles of.
- You get the discord ID of the user via OAuth2 (identity or email)
- With that User-ID you can then use any discord API wrapper (discord.py for example) to use the existing bot inside that server to get the roles of that user.
As you can see, you'll need to take that additional step because discord keeps everything that is inside a server i.e. roles, messages private so a bot is needed to leak these information to applications outside of discord.