๐Ÿ™Œ Check if a Discord user is sponsoring you/someone on GitHub and give them roles!

Overview

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!

You might also like...

๐ŸŒฑ React and redux based, lightweight and elm-style framework. (Inspired by elm and choo)

๐ŸŒฑ React and redux based, lightweight and elm-style framework. (Inspired by elm and choo)

English | ็ฎ€ไฝ“ไธญๆ–‡ dva Lightweight front-end framework based on redux, redux-saga and react-router. (Inspired by elm and choo) Features Easy to learn, eas

Jan 4, 2023

A blazing fast React alternative, compatible with IE8 and React 16.

A blazing fast React alternative, compatible with IE8 and React 16.

Nerv is a virtual-dom based JavaScript (TypeScript) library with identical React 16 API, which offers much higher performance, tinier package size and

Jan 4, 2023

Write JSX-driven components with functions, promises and generators.

Crank.js Write JSX-driven components with functions, promises and generators. Documentation is available at crank.js.org. Crank.js is in a beta phase,

Jan 1, 2023

The simplest way to create web components from plain objects and pure functions! ๐Ÿ’ฏ

๐Ÿ… One of the four nominated projects to the "Breakthrough of the year" category of Open Source Award in 2019 hybrids is a UI library for creating web

Dec 27, 2022

Simple and elegant component-based UI library

Simple and elegant component-based UI library

Simple and elegant component-based UI library Custom components โ€ข Concise syntax โ€ข Simple API โ€ข Tiny Size Riot brings custom components to all modern

Jan 4, 2023

A functional and reactive JavaScript framework for predictable code

Cycle.js A functional and reactive JavaScript framework for predictable code Website | Packages | Contribute | Chat | Support Welcome Question Answer

Jan 4, 2023

A Web Component compiler for building fast, reusable UI components and static site generated Progressive Web Apps

A Web Component compiler for building fast, reusable UI components and static site generated Progressive Web Apps

Stencil: A Compiler for Web Components and PWAs npm init stencil Stencil is a simple compiler for generating Web Components and static site generated

Jan 4, 2023

Re-developed the Sky Ice Cream website using ReactJS. Redesigned the UI to a much more appealing and intuitive styling.

This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: npm start Runs the app in the developmen

Dec 27, 2021

Write components once, run everywhere. Compiles to Vue, React, Solid, Angular, Svelte, and more.

Write components once, run everywhere. Compiles to Vue, React, Solid, Angular, Svelte, and more.

Write components once, run everywhere. Compiles to: At a glance Mitosis is inspired by many modern frameworks. You'll see components look like React c

Jan 1, 2023
Owner
EGGSY
Full-stack web developer - in โค๏ธ with Node.js, TypeScript, Flutter, Vue.js, React.js and SSR - ๐Ÿ‡น๐Ÿ‡ท ๐Ÿ‡ฌ๐Ÿ‡ง
EGGSY
Write you own GitHub webhooks with Deno Deploy.

Hooray Write you own GitHub webhooks with Deno Deploy. Deno Deploy is where you can distribute your JavaScript/TypeScript code to the edge with one li

null 3 Jun 22, 2022
A declarative, efficient, and flexible JavaScript library for building user interfaces.

React ยท React is a JavaScript library for building user interfaces. Declarative: React makes it painless to create interactive UIs. Design simple view

Facebook 200k Jan 4, 2023
A declarative, efficient, and flexible JavaScript library for building user interfaces.

Solid is a declarative JavaScript library for creating user interfaces. It does not use a Virtual DOM. Instead it opts to compile its templates down t

Ryan Carniato 24.5k Jan 4, 2023
:fire: An extremely fast, React-like JavaScript library for building modern user interfaces

Inferno is an insanely fast, React-like library for building high-performance user interfaces on both the client and server. Description The main obje

Inferno 15.6k Dec 31, 2022
Tiny (2 KB) turboboosted JavaScript library for creating user interfaces.

Develop web applications with 100% JavaScript and web standards. ?? RE:DOM is a tiny (2 KB) UI library by Juha Lindstedt and contributors, which adds

RE:DOM 3.2k Jan 3, 2023
๐ŸŒ™ The minimal & fast library for functional user interfaces

Moon The minimal & fast library for functional user interfaces Summary ?? Small file size (2kb minified + gzip) โšก Blazing fast view rendering ?? Purel

Kabir Shah 6k Jan 2, 2023
๐Ÿ“ƒ Violet is an open-source discord bot with multiple functions written in TypeScript.

?? About Violet is a JavaScript Discord bot focused on utility and game functions. It have a temporary channels system, minecraft and league of legend

Violet 3 Nov 11, 2022
OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.

OpenUI5. Build Once. Run on any device. What is it? OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on al

SAP 2.7k Dec 31, 2022
A modest JavaScript framework for the HTML you already have

Stimulus A modest JavaScript framework for the HTML you already have Stimulus is a JavaScript framework with modest ambitions. It doesn't seek to take

Hotwire 11.7k Dec 29, 2022