Code Monkey home page Code Monkey logo

bao-discord's Introduction

bao-discord

Discord Whitelist- and Permission-System for alt:V

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

install the following modules for NodeJS: axios fs useful discord.js

You need to create a bot in your Discord: https://discord.com/developers

when creating the bot under "OAuth2 --> Redirects --> General" enter the following:
http://127.0.0.1

Activate the following when creating the bot under "Bot":
PRESENCE INTENT
SERVER MEMBERS INTENT
MESSAGE CONTENT INTENT

To invite your bot to your server, go to: "OAuth2 --> URL Generator"
here you activate under SCOPES: bot
and under BOT PERMISSIONS: Administrator

Now you can open the url generated at the bottom in a TAB or window

note the following for the config.js:
Application ID / Client ID
Client Secret

now you open the ./config/config.js in an editor and fill out ALL fields
save and close, copy the whole folder in your resource.
now add "bao-discord" to your server.cfg
and if you did everything right, the bot will appear in your discord when you start the resource and your console should list who is whitelisted, admin, mod, supporter

you can use the rights management in your scripts:
import { refreshWhitelist, isAdmin, isMod, isSupporter } from 'bao-discord'.


refreshWhitelist() --> reload your whitelist
isAdmin(player) --> return true or false
isMod(player) --> return true or false
isSupporter(player) --> return true or false

bao-discord's People

Contributors

k37z3r avatar

Watchers

 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.