/Pinebot

A Docker logfile listener in a Discord bot

Primary LanguagePython

Pinebot

dependencies dependencies dependencies

Key FeaturesSet UpHow It WorksCommandsDevelopmentCreditsLicense

This project is being rewritten with pycord after discord.py was deprecated; Some features may be outdated or not work as intended.

Pinebot is a Discord bot which reads and reacts to events on Docker game servers. Pinebot links communication channels by passing new messages to other mediums, calculates playtime by keeping track of when players leave and join, and provides a secure method of interacting with a gameserver console through use of role restricted Discord commands.

Key Features

  • Combines chatrooms across platforms
  • Playtime logging
  • Configurable remote console access
  • Configurable Docker log filtering

Set Up

Currently this application only works with itzg's dockerized minecraft server running vanilla Minecraft servers. An example docker-compose file can he found here.

To clone, build, and run this application, you'll need Git and Docker installed on your computer. From your command line:

# Clone this repository
$ git clone https://github.com/EmmettPeck/Pinebot

# Go into the repository
$ cd Pinebot

# Place Discord Bot Key into ".env" file
$ echo "TOKEN=REPLACE-WITH-TOKEN" >> .env

# Build Docker Image
$ docker build pinebot .

# Start Docker Compose Services
$ docker compose compose.yml up -d

Note This guide is only tailored for linux systems running a bash kernel.

Linking A Channel

In a server with a bot connected to your bot token, link the running gameserver container to a Discord channel. >addserver <name> <Minecraft:version> <container_name> <ip> <description>. This can only be done by a Discord server's owner.

Example: >addserver example Minecraft:1.19 examples_mc localhost:25565 this is an example!

How It Works

  • By connecting in a Docker network, the Pinebot container is able to read the log files of connected gameserver containers.

  • By linking a Discord channel using the >addserver command and providing the name of a running container, Pinebot will begin to read the logs.

  • Using the version supplied in the >addserver command, Pinebot filters the logs using version specific criteria, and enables game specific commands in that channel.

Commands

Most commands can only be used in discord channels linked to game servers.

  • >playtime <server> <user> reports a player's total time playing on a server.
  • >list lists a linked server's online players
  • >sendcmd <command> sends command to server console. Only usable by server administrators.
  • >whitelist <playername> whitelists playername on linked server
  • >serverlist lists unhidden servers in a neatly formatted message.

Development

Development priority is going to rewriting the project to use MongoDB for more efficient data storage and Pycord for additional discord features.

Account Link

Allows Discord users to link multiple game server accounts.

Linked accounts allow for totaling playtime of a user, automating whitelisting across a server network, and more.

Other Games

Support for the following game servers are planned:

Credits

This software uses the following open source packages:

This software is built to run alongsize the following open source applications:

License

This repository currently has no license.