A bot that gives roles if a user is supporting you on GitHub! Uses Discord OAuth and Discord GitHub integration to get user's handle and then checks through GitHub GQL API.
demo.mp4
Make sure they are all installed on your system before setting up this bot.
Before doing everything, make sure you have everything set up and ready to go. You'll also have to run npm install
command or your preffered package manager command to install the dependencies.
- Rename
.env.example
to.env
and fillGITHUB_TOKEN
,DISCORD_BOT_TOKEN
andDISCORD_CLIENT_SECRET
. - Rename
src/config.example.ts
tosrc/config.ts
and fill the fields.โ ๏ธ You'll also have to configure the Redirects from your Discord Application settings to the same Callback URL you use in this file.
Run the bot and wait until you see 3 successful messages in your console that states web server, bot and REST has started working fine. Then go to your server where you invited the bot (you have to invite the bot with the application_commands
scope) and then run the slash command /get-sponsor-role
. You can also do this by running the same command within the bot's DMs. The bot will send you an OAuth link to log you in and get the connections from your profile. Click on the link and login with your Discord account. It'll get your GitHub name and check if you are sponsoring the given person on GitHub, will give you all the roles that are set in the config if you do.
- Since this bot is getting the GitHub username from user's Discord integrations, all users have to connect their GitHub accounts to Discord.
It was created for @antfu's Discord server.
Create an issue and let me know!