A Discord bot to manage Docker Resonite headless servers without mods.
Note
The bot is intended to be used with Docker. See the Resonite Wiki, how to setup a Headless with Docker.
- Restart headless
- List Sessions
- Change tickrate
- Change world of session
- Show world config
- Command logging
| Restart & Logs | Session List | Session Config |
|---|---|---|
![]() |
![]() |
![]() |
- Docker with Docker-Compose
- A Discord Bot
- Doesn't require any special permissions;Can be handled with channel permissions
- A Docker-based Resonite Headless
Note
If you need help setting up this program, hit me up on Discord: the.phil.
-
Invite your Bot to your Discord Guild/Server and make sure to create two channels and give it read and send permissions to them:
- log-channel: Posts access and error logs, when a command is used or the bot did something on its own
- world-list-channel: Used for a list of worlds, the bot will use to change the config. (Will be explained further down.)
-
Create a role for permission management, of who can use the bot.
-
Open the docker compose of your Resonite Headless with your editor of choice (vi/nano/...), add the following labels and adjust the values to their description. Make sure you have Discord developer mode enabled to get the Discord IDs.
-
labels: discordBot: true discordBotAccessRole: 0000000000000000000 discordBotLogChannel: 0000000000000000000 discordBotWorldListChannel: 0000000000000000000
-
-
Download this repo:
git clone https://github.com/FlippedCodes/Resonite-Headless-Discord-Bot -
Copy
dist.envto.env:cp dist.env .env -
Open
.envand update all required values- This file is used for sensitive information like tokens and passwords
-
Open
config.jsonand update it as welltickrateRangeis the only thing of interest here (so far)discordEventMgmtcan be disabled, if not in use.
-
Open
docker-compose.ymland add your resonite headless config file undervolumes- Change config-mapping
- Left of the
:is "outside" of the container and right "inside" of the container - Keep the
docker.sockmapping - The filename "inside" the container needs to match the docker-compose project name
- Use
docker compose lsto list all your project names
- Use
- You can use the the
resonite-femapping as an example. But this should be removed, before saving the file, cause that one is my mapping and doesn't exist on your system.
- Left of the
- Change your timezone
- Thi sis only required, if you use the
discordEventMgmt-feature
- Thi sis only required, if you use the
- Change config-mapping
-
Startup your services:
docker compose up -d -
????
-
Check the logs for, if the startup was successful:
docker compose logs -f -
PROFIT!!!!
All commands become available to a user, when they have the discord role, that was created in installation step 2.
Rules:
- All optional commands are used to set an option. If not used, the bot will only display the information back to you.
The restart command restarts the docker container without using the headless shutdown command. This causes the world to not save, before shutdown!
In order to set a world with the /config session command a world-list is required and is managed through the channel that was created in installation step 1.2.
Rules:
- Every world needs to be an individual entry.
- Messages can be created, updated and deleted on the fly, without requiring a restart of the bot.
- Message Layout
- First line - Title
- Second line - Description
- Can be used for an update date.
- Resrec-link - Has to start with
resrec:/// - Tags - Has to start with
tags:- Tags are used to narrow down the world selection for a session and needs at least one tag in common with the resonite headless world-config to show up.
- Additional info can be added below but is irrelevant for the bot
- Adding a ❌ reaction to the message, marks the world as disabled and it wont show up in the drop down list.
Example:
TEST WORLD
Some short Description.
resrec:///U-someuser/R-some-resrec-link
tags:foo,bar
At Fur.Earthers we have a lot of hosts, which all need to regularly change worlds or restart the headless in case of mishaps. Because most of the teammember are not familiar with Docker or Linux commands, I created this bot to manage some basic settings of the headless and their sessions through Discord.
There are no limitations known at this time, but the features have to be implemented first.
Since this belongs to critical infrastructure, that has to work, I wanted something that is unlikely to break from upcoming features. Mods on Resonite are quite resilient to do so, but nothing beats good old cli commands and config parsing. This also helps to easily add or remove the bot as desired.
I like docker. It's a cheap and easy way to keep applications separate, while having some security for the underlying host OS and offering an API for shenanigans like this project.
To keep it simple and usable for multiple discord servers and headless containers, I opted to not have any database to hold the data. This also prevents complicated overwrites protections, in case the config has to be changed manually and the need to more complicated discord-commands. The Redis DB is required by the Discord.JS Framework Sapphire to have scheduled tasks for upcoming features.
- Refactor Logging
- Add soft restart feature
- Checks, if the headless is empty for scheduled restarts
- Check for headless updates and apply the automatically
- Write a proper instructions for creating a Discord Bot




