2022-06-07 15:31:09 +02:00
2022-06-07 15:43:06 +02:00
2022-06-08 01:18:49 +02:00
2022-06-08 01:16:34 +02:00
2022-05-11 19:57:25 +00:00
2022-05-26 23:29:22 +02:00
2022-06-07 15:31:09 +02:00

Mosscraft

Description

Discord bot that shows the status of your minecraft server making usage of the Query requests.

Requirements

docker
docker-compose
git

How to run

Creating a docker network

First we need to create a docker network for our both containers (minecraft and discord) to communicate.

docker network create my_minecraft_network

Join already running container to the network created

Docker

docker network connect my_minecraft_network minecraft_server

Docker-Compose

Where "..." stands for previous existing configuration.

networks:
   ...
   my_minecraft_network:
      external: True
...

   minecraft_server:
       ...
       networks:
          ...
          my_minecraft_network:

ready-to-go deploy with docker-compose

First we're going to build the docker images.

docker-compose build

Afterwards we can start the server.

docker-compose up -d

Finally we proceed to check the logs to see everything is working properly.

docker-compose logs -f

Configuration

Environments

Environment Default Value Description
MINECRAFT_HOSTNAME <Null> Hostname/IP to connect to the minecraft server/container.
MINECRAFT_QUERY_PORT 25565 Port to connect to the minecraft server through the RCON protocol (must be enabled on the server).
MINECRAFT_RCON_PORT 25575 Not being used Port to connect to the minecraft server through the RCON protocol (must be enabled on the server).
MEMCACHED_HOSTNAME <Null> Hostname/IP to connect to the memcached server/container.
MEMCACHED_PORT 11211 Port to connect to the memcached server.
MEMCACHED_USERNAME <Null> Username to authenticate to the minecraft server.
MEMCACHED_PASSWORD <Null> Password to authenticate to the minecraft server.
DISCORD_TOKEN <Null> Hostname/IP to connect to the minecraft server/container.
DISCORD_PREFIX mc. Prefix for the discord bot to read the commands.
DISCORD_DESCRIPTION Hi, I'm a Bot!
My function is to help you!
Description for the bot.
DISCORD_MC_URL <Null> Url to display for the users to join the server.
DISCORD_MC_REFRESH_COOLDOWN 20 (not implemented yet)(seconds) Cooldown before doing another request to the minecraft server and insert it to the memcached server (while on cooldown will grab the data from the memcached server)

Working Examples

Status command example

Connectivity error example

Description
Discord bot that shows the status of your minecraft server making usage of the Query requests.
Readme 582 KiB
v1.0 Latest
2022-06-07 15:49:16 +02:00
Languages
Python 94.9%
Dockerfile 5.1%