Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minecraft Whitelist

A simple Python Discord bot designed to be hosted on the same hardware as a Minecraft server, allowing it to update the whitelist.json file. This bot was created for a friend who set up a Minecraft server so that members of their Discord could self-whitelist.

Deployment

⚠️ Prerequisites ⚠️

Python Version 3.12 and Virtual Environment:

sudo apt install python3 python3-venv

Python3-pip

  1. Update Package lists
sudo apt update
  1. Upgrade the System (optional but recommended):
sudo apt upgrade
  1. Install python3-pip
sudo apt install python3-pip

🔧Installation🔧

  1. Clone the repository:
git clone https://github.com/Infinity585/Discord_Minecraft_Whitelisting.git
  1. Navigate to the repository directory: Change into the repo directory
cd Discord_Minecraft_Whitelisting/
  1. Set up a Python Virtual Environment:
python3 -m venv env
source env/bin/activate
  1. Install Python dependencies:
pip3 install -r requirements.txt
  1. Configure the .env file:
nano .env
  1. Paste in and fill out the fields:
token =  (discord bot toekn)
applicationid = (discord applicationid)
jsonPath = (full path)
logChannel = (discord channel id)

To save changes and exit in nano:

  1. Press to exit
ctrl + x
  1. Save changes (Save modified buffer?)
y
  1. Write to file (File Name to Write: .env)
Enter

🏃Running the program🏃

Run the bot:

 Python3 main.py

If using SSH, keep the program running with screen

  1. Start a screen session:
screen -S minecraftDiscordBot
  1. Navigate to the repository directory
cd Discord_Minecraft_Whitelisting/
  1. Enter the Virtual Environment
source env/bin/activate
  1. Run the program
python3 main.py

The bot should now be running, and the SSH terminal can be safely closed.

To list screen sessions:

screen -ls

To reattach a session:

screen -r <id or name>

Discord Commands

/whitelist <minecraft username>

About

Discord bot for adding Minecraft whitelisting.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages