Git Product home page Git Product logo

discord-is-sponsor's Introduction

Discord: Is User Sponsor?

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

demo.mp4

Requirements

Make sure they are all installed on your system before setting up this bot.

  • Discord bot account (get it from here)
  • GitHub access token (get it from here)
  • TypeScript
  • Node.js

Configuration

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 fill GITHUB_TOKEN, DISCORD_BOT_TOKEN and DISCORD_CLIENT_SECRET.
  • Rename src/config.example.ts to src/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.

Usage

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.

Notes

  • Since this bot is getting the GitHub username from user's Discord integrations, all users have to connect their GitHub accounts to Discord.

Backstory

It was created for @antfu's Discord server.

Any Problems?

Create an issue and let me know!

Sponsors

discord-is-sponsor's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.