Coder Social home page Coder Social logo

athena-plugin-discord-allow-list's Introduction

Athena Plugin - Discord Allow List

A plugin for Allow Listing on Discord when Authenticating with the Athena Framework's Discord Login compatible with 5.1.0 of the Athena Framework.

  • Ensures a user is in your Discord.
  • Ensures a user has an allow list role.

A user who is not in your Discord Server will never be able to join.

Installation

  1. Open a command prompt in your main Athena Directory.
  2. Navigate to the plugins folder.
cd src/core/plugins
  1. Copy one of the commands below.

SSH

git clone [email protected]:Athena-Framework-V5/athena-plugin-discord-allow-list.git

HTTPS

git clone https://github.com/Athena-Framework-V5/athena-plugin-discord-allow-list
  1. Navigate into src/core/plugins/athena-plugin-discord-allow-list
  2. Open the config.ts file.
  3. Fill in the information in the configuration including IDs for roles to allow list.

All the information can be obtained from https://discord.com/developers/applications

  • You need to create a bot.
  • You need to copy the bot's token and put it into the configuration.
  • You need to copy the Discord Guild Identifier. Which can be obtained in developer mode on Discord. Google it.
  • Turn off public bot, Turn on SERVER MEMBERS INTENT and PRESENCE INTENT in the bot settings.
  • Ensure the bot is in your Discord Server
  • Ensure the bot can see all users
  1. Start the server, watch for any warnings.
  2. If no warnings then the plugin was configured successfully.

API Usage

This plugin comes with a small API with some general functions.

  • getMember(discord: string)
  • enableAllowList(shouldEnable: boolean)
async function doSomething() {
    const allowListApi = await Athena.systems.plugins.useAPI('discord-allow-list');
    if (typeof allowListApi === 'undefined') {
        return;
    }

    // Allow anyone to join the server.
    allowListApi.enableAllowList(false);

    // Used to obtain a guild member, returns undefined if not in your discord server.
    const guildMember = await allowListApi.getMember('202685967935471617');
    console.log(guildMember);
}

athena-plugin-discord-allow-list's People

Contributors

stuyk 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.