Giter Club home page Giter Club logo

gatekeeperv2's Introduction

Gatekeeper V2

Welcome to the efforts of countless hours of learning and failed attempts at writing code that culminated into this project known as Gatekeeper! Originally this started out as a bot to bring CubeCoders AMP to Discord with support for only Minecraft, but has evolved into this encompasing project of providing support for any type of server AMP can run along with providing as many of AMPs core features inside of Discord.

Need Support or have questions? Please visit my Discord and post in the respective channels. Come Join my Discord - Kat's Paradise

Features


  • User friendly with very basic setup required by the User. Gatekeeperv2 can manage its own permissions inside of AMP.
    • Can Support more complex Permission setups. See the Permissions Guide for more information.
  • Ability to control AMP Servers with Discord slash commands and Text input.
    • Interaction with AMP Server Consoles and Server Chat via Discord Text Channels.
  • Uses a SQL Database to store Users and Server information.
  • Full support inside of AMP via AMP Template with constant updates.
  • Cross platform support; Windows or Linux.
  • Support for your own Cogs/AMP Dedicated Server.
    • See cog_template.py and amp_template.py for brief examples.
  • Uses Autocomplete features to help complete commands and help navigation.
    • Full Support for Discord Channels, Discord Roles and AMP Servers.
  • Supports custom Banner images for displaying AMP Server specific information.
  • Supports Regex Patterns for custom filtering of your AMP Console to Discord Channel output
    • This also works on Events such as Disconnect, Deaths and Kills.

Requirements



Creating a Discord Bot Account

  1. Please visit Creating a Bot Account

Installation Methods


Manual Instructions

  1. Create an AMP user for the Bot with Super Admins role, must be done on the Global AMP Home Screen GUI.
    • Usually this is the URL ending in 8080 when connecting to AMP. (eg. http://X.X.X.X:8080)
  2. Follow the instructions in tokenstemplate.py file -> tokenstemplate.py
  3. From Command Line run script start.py (eg. ../Discord Bot/start.py)
    • Run the bot, it will finish installing the rest of the requirements.
  4. See Interacting with the Bot~

AMP Instance Instructions

  1. Create an AMP user for the Bot with Super Admins role, must be done on the Global AMP Home Screen GUI.
    • Usually this is the URL ending in 8080 when connecting to AMP. (eg. http://X.X.X.X:8080)
  2. Create a new instance of GatekeeperV2 in a container. (The container option can be found under Configuration -> New Instance Defaults)
  3. Configure the settings in the GatekeeperV2 Instance under the Configuration -> Bot Settings, click Update, then start the bot.
  4. See Interacting with the Bot~

Interacting with the Bot

First Time Startup

  • After Gatekeeper has connected to your server, please run the command $bot utils sync.
    • This should populate all of its available commands to your guild.
  • See Commands for a full list of all Bot Commands and how to use them.
    • TIP: Parameters such as role and channel support IDs and names

Updating the Command Tree

  • When commands are added or removed it is highly suggested that you reset your command tree and re-sync
    • See Bot Commands /bot utils sync for details on how to reset your local command tree.

Setting up a NON-Discord Adminstrator Role for the Bot

  • Use /bot moderator (role) and the bot will add that role as the minimum required role to interact with the bot.
    • TIP: Use this if you want NON-Discord Admins to have the ability to interact with the bot
    • It does honor the role heirarchy set via Discord -> Server Settings -> Roles.
    • Want more control? See Setting up Custom Permissions.

Setting your AMP Console Channels

  • Use /server console channel (channel) and the bot will begin sending AMP Console messages to that channel.
    • TIP: You can also send AMP Console commands through that Discord Channel to the Dedicated Server.
    • ATTENTION: Interacting with the console this way requires a special permission node server.console.interact or having Discord Admin and or Bot Moderator Role.

Setting your AMP Chat Channels

  • Use /server chat channel (channel) and the bot will begin sending AMP Chat messages to that channel.
    • TIP: You can also send Chat messages through that Discord Channel to the Dedicated Server.

Setting your AMP Event Channels

  • User /server event channel (channel) and the bot will begin sending AMP Event messages to that channel.
    • Events are when a player Joins or Leaves and Achievements.

Setting your Whitelist Channel and Auto Whitelist Settings

  • Use /whitelist channel (channel) to set a channel for the bot to check whitelist requests.
    • ATTENTION: The Bot will not do anything with those requests unless you turn on auto-whitelist
  • Use /whitelist auto true to allow the bot to handle whitelist requests in your whitelist channel!
    • ATTENTION: The Bot has a default wait time of 5 minutes, after the wait time is up they are whitelisted.
  • Use /whitelist waittime (time) to adjust the Bot's wait time after a whitelist request.
    • TIP: You can set this value to None or 0 to allow the bot to instantly whitelist the user.

Setting up your Server Status Displays

  • First, set all your servers settings/information. See Server Commands

    • Adjust your settings on via sub commands such as Host, Description, DisplayName, PrefixandWhitelist` to name a few.
    • TIP: You can do this after you set your Display Banner location, the bot will updated the information automatically.
  • Pick which style of Display you'd like. The Bot supports Discord Embeds or Custom Images.

    • Use /bot banner type (type) and select the type of display you'd like.
  • Use /server display in the channel you wish to display your Server Status/Info..

    • TIP: You can pin the messages and thus never moving them!
    • ATTENTION: The Bot will update these banners every minute with current AMP and DB Information.

Launch Args

  • These are append to the command line when launching the bot. (eg. start.py -super)
    • -token - Bypasse tokens validation check. (Mandatory for AMP Template Installations/Operations)
    • -command - Enable slash command print statements for user traceback.
    • -super - This leaves AMP Super Admin role intact, use at your own risk.
    • -dev - Enable development print statments. (used for development)
    • -debug - Enables DEBUGGING level for logging. (used for development)
    • -discord - Disables Discord Intigration (used for testing)

Using Gatekeeperv2 as a Service

  • Log into your dedicated server/VPS via root.
  • You are then going to use the following command to create a service script for your Gatekeeper nano /etc/systemd/system/gatekeeper.service
    • Once done, input the following information into the service file.
[Unit]
Description= GateKeeperv2
After= network.service

[Service]
Type= simple
WorkingDirectory= # This points to the directory of Gatekeeperv2 files (eg. '/home/gatekeeper')
ExecStart= #This points to the python3 script. (eg. 'ExecStart=/usr/bin/python3.9 /home/gatekeeper/start.py')
Restart= always 
RestartSec= 15

[Install]
WantedBy= multi-user.target

Then run these in the command line.

systemctl daemon-reload
systemctl enable gatekeeper.service
systemctl start gatekeeper.service

Useful Command

  • Use systemctl status gatekeeper.service to see the status of the Gatekeeper Service!

Thanks @LeviN


Credits

"Thank You" to everyone at CubeCoders Discord Server, especially IceofWrath, Mike, Greelan and everyone else in their discord.

"Thank You" to everyone over at Discord.py Discord Server, especially SolsticeShard and sgtlaggy for all the silly questions I kept asking about embed's and Hybrid messages!


Want to Support?

Visit my Patreon

gatekeeperv2's People

Contributors

k8thekat avatar dw4lt avatar xlevinx avatar lightningth 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.