Package to help with easy OAuth2

Usage no npm install needed!

<script type="module">
  import easyDiscordJoin from 'https://cdn.skypack.dev/easy-discord-join';


Easy Discord Join


var DiscordJoin = require("easy-discord-join")
var JoinClient = new DiscordJoin({
  CLIENT_SECRET: 'client_secret',
  CLIENT_ID: 'client_id',
  SERVER_ID: 'server_id', //server to add users to
  CALLBACK_URL: 'https://yourcallbackurl.com/callbackroute', //callback uri
  TOKEN: 'discord_bot_token'

async function addUser(userID, access_token) {
  return await JoinClient.addMember(userID, accecss_token)

addUser('0100101010101001', 'kbdaas.92JEHGF') //fake userid and access_token, but who cares?

addMember(userID, access_token) -

  • userID: ID of user adding to server
  • access_token: Access Token for the user (granted from OAuth callback, check example @ line 21 for access_token usage.)

Returns: Promise

Check the API for more info.