Skip to content

Contribution Guide

Just Call Me Koko edited this page Mar 31, 2022 · 4 revisions

Contributing to the Python Discord Bot

The guide will detail the steps necessary to develop, run, and test this bot locally as well as submit merge requests with your code changes. Contributors will be responsible to resolving any merge conflicts created by their fork

Clone the repository

If you are not a collaborator on the project, you will need to fork this repo and make local clone of your fork

Setup Local Development Environment

This bot runs in Python which should allow you to setup any Python capable IDE you wish as long as you are using the correct version of Python

  1. Install desired Python IDE (VSCode is good)
  2. Install Git
  3. Install Python >=3.8
  4. Install dependencies with pip install -r requirements.txt

Setup Test Server

Just create a discord server and configure it anyway you want

Setup a bot account

Create the bot account you will be using to test the bot code and invite it to your test server. You will need to save the provided bot token for when you configure your bot.

Configure the bot

You will need to configure a .env file in the root of the project directory to contain the following information

# .env
DISCORD_TOKEN=Discord Token
DISCORD_GUILD="Target Discord Guild"
RCON_IP=IP of your minecraft rcon server
RCON_PASSWORD="password to the rcon server"
HOST_USER="Owner account of the minecraft server"

The .env is part of the .gitignore and will not be included in any commits

Run the bot

The end goal of the bot project is to be able to run it in a Docker contain. For now, the bot must be run locally from the host filesystem itself. You can either run the bot with a direct Python command or in a Screen session

  • python discord_bot.py

or

  • screen -S discordbot python discord_bot.py

Creating a plugin

See Creating a Plugin