Skip to content

wwebjs/discord-linkedroles

Repository files navigation


wwebjs.dev Guide

About

We have integrated linked roles into our Discord server, making it more organized and enhancing the user experience. Users can now link their Discord profile to GitHub, allowing us to verify their identity. This gives users access to additional channels and roles, such as Lib Contributor, Guide Contributor, and more. These roles are no longer assigned manually by the team; users can automatically receive them by visiting the role API and linking their Discord account.

How to use

  1. Link your Discord account to GitHub on the connections page in Discord.
  2. Open the dropdown menu in the Discord server and click on "Linked Roles".
  3. Select the role you want to assign to yourself and press on the WWebJS requirement.
  4. Visit the role API and log in with your Discord account.
  5. The role API redirects you and displays a log-in/failed/success page with information.
  6. You can now collect the roles and access the channels.

Here you can find an exmaple of the process.

How it works

The user connects at /verify and is then redirected to log in with Discord. After logging in, the user is redirected to our role API, which sends a request to the Discord API to obtain the user's Discord identity. The user is then redirected back to /discord-oauth-callback, where the information is processed. The role API checks the database to see if the user is already registered, whether they are blocked manually, and if a request to GitHub has been made in the last hour to reduce data traffic. If not, the role API sends a request to the GitHub API to get the user's GitHub contributions. Then, the role API sends a request to the Discord API to add metadata information. If everything is successful, the user will see a success page. The user can now collect roles on Discord and access restricted channels.

Resources

WWebJS Links

License

WWebJS discord-linkedroles is licensed under the MIT license. Please see the LICENSE file for more information.