Code Monkey home page Code Monkey logo

game-servers-manager-bot's Introduction

Multiplayer Game Servers Manager Bot for Discord

What is this?

This is a Discord bot that can start your AWS EC2 instance, wait for your game server to finish starting and then send a Discord message with the IP. It also checks the number of players every 15 minutes (configurable), and if the server is empty, stops it and shuts down the EC2 instance.

Features

  • can start your EC2 instance + game server (if configured via crontab)
  • supports changing IPs (no need to assign a static IP to your instance)
  • auto-closes the game server if no one is online
  • stats command to check IP and online players without opening the game
  • stop server and shutdown instance via Discord
  • modpack command which will reply with the modpack download link (optional)
  • manage multiple servers! Multiple instances, multiple games, and multiple servers of the same game! You can even setup which members of your server can manage each server!

Commands

All commands are used like: @bot <command> [servername]

help

Bot will reply with a list of commands and servers configured

modpack

Bot will reply with the modpack download link

Aliases: pack, link

open

Will start your EC2 instance, wait for the game server to start and then send the IP to chat.

If the instance is already started, it will wait for the game server to start and then send the IP to chat. If the server is already open it will only send the IP.

Aliases: start

stop

Will stop your game server and shutdown your EC2 instance, but only if the server is empty

stats

Will reply with the number of online players, the maximum players (if the game supports it), the names of all online players and the server IP.

How to use?

1 - Create your AWS EC2 instance

2 - Install your supported server (see supported games)

3 - Add an entry to your @reboot crontab to open the server in a screen or tmux session on reboot

4 - Configure the bot and host it somewhere else. To configure, you have to edit config.json and set the required environmental variables. You can either copy .env.example to .env and set them there or use your hosting service's service. The list of environmental variables you have to set are in the .env.example file:

  • TOKEN - your Discord bot token
  • AWS_ACCESS_KEY_ID - your iam (recommended) or root user (not recommended) access key
  • AWS_SECRET_ACCESS_KEY - your iam (recommended) or root user (not recommended) secret access key

Supported Games

This bot started out as a Minecraft-only server management bot. It was refactored to permit easy additions of new games. See Contributing and Translating or open a GitHub Issue if you are interested in having your favorite game supported by the manager!

For the moment, the only supported game is Minecraft.

See planned features for a list of planned games.

Can you do/fix X?

I can certainly try my best.

Open a GitHub Issue with your suggestion or bug report :)

Contributing and Translating

Yay for open source development! To contribute, just open a pull request and I will review!

The files for translating are in the languages folder. Just copy the english.json file and change it into your language. Thank you! :D

Planned features and changes

  • maybe use RCON instead of SSH to send /stop command to minecraft server
  • add support for ARK: Survival Evolved
  • change bot to use custom status as soon as it's released for bot users (depends on discord devs, not me)

Known bugs and issues

  • the help command does not send the command list. This is a TODO because it will require refactoring the way commands are handled in order to do properly.

game-servers-manager-bot's People

Contributors

dependabot[bot] avatar nichogx avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bchewy

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.