mirror of
https://github.com/opus-tango/minecraft-server-discord-bot.git
synced 2026-03-20 03:55:20 +00:00
finish readme and clean up json examples
This commit is contained in:
38
README.md
38
README.md
@@ -2,9 +2,17 @@
|
||||
|
||||
A simple discord bot written in python for managing multiple minecraft servers through the same discord server.
|
||||
|
||||
The bot can start a server and stop a server. It can also force stop a server if the server hangs. The list of servers the bot can manage is stored in a json file. See servers.json.example for an example of the json file. I want to support passing the minecraft chat through to discord, but I'm running into parsing errors with python's regex library. Passing discord chat through to minecraft does work.
|
||||
## Features
|
||||
|
||||
### Installation
|
||||
- Manages an arbitrary number of minecraft servers (and makes sure only one server is active at a time)
|
||||
- Enables players to list, start, and stop servers from the discord server
|
||||
- Can force stop a server if it hangs
|
||||
- Listens to both discord and minecraft chat and forwards them back and forth so that the users in game and on discord can chat together
|
||||
- Enables sending commands to the currently running server via discord
|
||||
- Uses a simple json file to store the servers the bot can manage, including the path to the server folder, the server name, and the command to start the server (for instance a script file or directly calling a jar)
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
1. Clone the repository
|
||||
2. Install the required packages with `pip install -r requirements.txt`
|
||||
@@ -15,7 +23,7 @@ The bot can start a server and stop a server. It can also force stop a server if
|
||||
7. Run the bot with `screen -mS startbot python3 bot.py`
|
||||
|
||||
|
||||
### Usage
|
||||
## Usage
|
||||
|
||||
Commands:
|
||||
- !help - Displays this help
|
||||
@@ -30,14 +38,34 @@ Commands:
|
||||
**NOTE:**
|
||||
The bot allows running arbitrary scripts defined in the json file, and arbitrary commands if a discord user has the admin role and one of the startserver scripts opens a shell. This program is a proof of concept personal tool, and is not designed for robustness or security. Use it at your own risk, and make sure you understand the security implications if you decide to use it for more than basic testing. I do not accept any liablilty for any damage caused by the use of this program.
|
||||
|
||||
## Configuration
|
||||
|
||||
### TODO
|
||||
#### The bot requires a .env file (or equivalent) to access the discord bot token.
|
||||
|
||||
`BOT_TOKEN=<token>`
|
||||
|
||||
#### The config.json file contains the following keys:
|
||||
|
||||
- chat_channel: The discord channel to send messages to
|
||||
- command_channel: The discord channel to send commands to
|
||||
- command_prefix: The prefix for commands
|
||||
- regex: A list of regular expressions to match server output
|
||||
- match: The regular expression to match
|
||||
- fstring: The format string to use for the message ({groups} will be replaced with the groups from the regex match)
|
||||
|
||||
#### The servers.json file contains the following keys for each server:
|
||||
|
||||
- path: The path to the server folder
|
||||
- servername: The name of the server (used to start the server via Discord)
|
||||
- command: The command to start the server
|
||||
|
||||
## TODO
|
||||
|
||||
- [x] Add currently running server variable
|
||||
- [x] Add running server check to prevent multiple servers running
|
||||
- [x] Add list command to see currently running servers
|
||||
- [x] Add server stop command
|
||||
- [x] Add server command command
|
||||
- [ ] Add server message passthrough
|
||||
- [x] Add server message passthrough
|
||||
- [x] Add help command
|
||||
- [x] Add discord message passthrough
|
||||
Reference in New Issue
Block a user