Skip to content

Installation and Configuration

iDarkLightning edited this page Jul 13, 2021 · 4 revisions

Installing and Configuring the Bot

Prerequisites

In order to use this bot, you must have docker and docker-compose installed on your system. You can learn how to install them here.

Installing

Once you are done installing those, you can follow this guide to set up a discord application.

After you have created a discord application, you can clone this repository like such:

git clone https://github.com/iDarkLightning/LiteBot.git

Environment Variables

After cloning the repo, rename the .env.template file to .env and fill out your environment variables.

  • SERVER_PORT: The port that the LiteBot server should run on
  • SERVER_DOMAIN: The domain for the LiteBot server, should be set to http://<ip>:<port> if no domain is configured
  • USING_LTA: Whether or not the servers are running litebot-mod
  • MONGO_EXPRESS_PORT: The port that the mongo-express server should run on
  • DB_USERNAME: The username to log in to the database
  • DB_PASSWORD: The password to log in to the database

Running

You can run the bot by running the following command inside the bot's directory:

docker-compose up # you can add -d if you would like the bot to run in the background

You can shut down the bot by running:

docker-compose down

Configuring

After the first run, a config file should be generated at config/config.json.

Within the server server.properties of your server(s) configure these properties:

  • broadcast-rcon-to-ops should be set to false in order to ensure that the chat is not spammed for OP players from bot usage
  • enable-rcon must be set to true
  • rcon.port set to a unique port (not same as server port)
  • rcon.password create a secure password

You must fill in the following fields inside config.json:

  • token: The bot token for your discord app
  • prefixes: The prefixes that the bot will respond to
  • main_guild_id: The ID of the main guild that the bot will be used in
  • log_channel_id: The channel that log messages will be sent in
  • api_secret: The secret key to use for signing and validating tokens
  • servers: All the servers that the bot will have access to. You can add as many as you would like
    • name: The name of the server, and the key that will be used to access the server
    • numerical_server_ip: The server IP address
    • server_port: The port that the server is running on
    • rcon_port: The port that the RCON listener is running on (set in server.properties)
    • rcon_password: The RCON password you set in the server.properties
    • operator: Whether or not all players on the server should receive OP
    • bridge_channel_id: The "bridge" channel for the server. Meant for usage with the chat bridge plugin.

Configuring Settings

You can read about configuring the various settings for the bot here

Updating

Updating the bot is extremely simple. Simply run:

git pull

To pull the latest version of the bot from the git repository.

Clone this wiki locally