A Discord bot for managing Minecraft servers through RCON commands.
- Clone this repository
- Create a virtual environment:
python -m venv .venv - Activate the virtual environment:
- Windows:
.venv\Scripts\activate - Linux/Mac:
source .venv/bin/activate
- Windows:
- Install dependencies:
pip install -r requirements.txt - Create a
.envfile with your Discord bot token:TOKEN=your_discord_token_here - Run the bot:
python main.py
/add_server- Add a new Minecraft server (admin only)/list_servers- List available Minecraft servers/say- Broadcast a message on the server/weather- Set weather (clear, rain, thunder)/whitelist- Add yourself to the server whitelist/custom- Run custom RCON command (admin only)
Servers are stored in servers.json with the following structure:
{
"server_key": {
"host": "server_ip",
"port": 25575,
"password": "rcon_password",
"allowed_guilds": [guild_id1, guild_id2]
}
}- Always keep your
.envfile out of version control - Reset your bot token if it has been exposed
- Be careful about who has admin privileges in your Discord server, as they can run custom commands