A Discord bot specifically designed to monitor MC Server Soft servers and automatically update Discord channels with real-time server status information.
Note: This bot is optimized for servers running with MC Server Soft - the free Minecraft server wrapper UI for Windows.
- 🔍 Real-time MC Server Soft server status monitoring
- 📊 Automatic Discord channel updates
- 🛡️ Minimal permission requirements for enhanced security
- 🐍 Python-based with simple setup
- 🖥️ Designed specifically for MC Server Soft wrapper integration
- Python 3.10 or higher
- MC Server Soft installed and running
- Discord bot token (Create a bot here)
- Minecraft server managed by MC Server Soft
Using conda/miniconda for environment management:
# Create a new environment
conda create --name discord-bot python=3.10
# Activate the environment
conda activate discord-bot
pip install discord.py requests
- Clone this repository or download the code
- Open
discord_bot.py
in your preferred code editor - Find the settings section between
#Settings Starts:
and#Settings End---
- Configure your bot settings:
- Discord bot token
- Channel ID where updates will be sent
- Minecraft server address and port
- Update interval
- Go to Discord Developer Portal
- Create a new application and bot
- Copy the bot token for configuration
- Invite the bot to your server with these permissions:
Send Messages
Manage Messages
⚠️ Security Note: Only grant necessary permissions. Avoid giving "Administrator" permissions to prevent potential security risks.
Create a run_bot.bat
file in the same directory as your Python script:
Option A: Default conda installation
@echo off
echo Starting Discord Bot...
echo.
REM Activate conda environment
call conda activate discord-bot
REM Check if activation was successful
if errorlevel 1 (
echo Error: Could not activate conda environment 'discord-bot'
echo Please make sure the environment exists and conda is properly installed.
pause
exit /b 1
)
echo Environment activated successfully!
echo Running Discord bot...
echo.
REM Run the Python script
python discord_bot.py
REM Keep the window open if there's an error
if errorlevel 1 (
echo.
echo Bot stopped with an error. Check the output above.
pause
)
Option B: Custom conda installation path
@echo off
echo Starting Discord Bot...
echo.
REM Set custom conda path (modify this to your conda installation path)
set CONDA_PATH=C:\Your\Custom\Path\To\Miniconda3
REM Initialize conda for batch file
call "%CONDA_PATH%\Scripts\activate.bat" "%CONDA_PATH%"
REM Activate your environment
call conda activate discord-bot
REM Check if activation was successful
if errorlevel 1 (
echo Error: Could not activate conda environment 'discord-bot'
echo Please check your conda path and environment name.
pause
exit /b 1
)
echo Environment activated successfully!
echo Running Discord bot...
echo.
REM Run the Python script
python discord_bot.py
REM Keep the window open if there's an error
if errorlevel 1 (
echo.
echo Bot stopped with an error. Check the output above.
pause
)
To use the batch file:
- Choose the appropriate version based on your conda installation
- If using Option B, modify the
CONDA_PATH
to match your installation directory - Save as
run_bot.bat
in your project folder - Double-click
run_bot.bat
to start the bot - The CMD window will show the bot status and keep running
- Open the project in Visual Studio Code
- Select the correct Python interpreter (your conda environment)
- Press
Ctrl+Shift+P
→ "Python: Select Interpreter" - Choose the
discord-bot
environment
- Press
- Press
F5
or click the "Run" button to start the bot
# Activate your environment
conda activate discord-bot
# Run the bot
python discord_bot.py
When running successfully, your bot will send status updates like this:
- IDE Compatibility: This bot has been tested with VS Code. If you encounter issues with other IDEs, try using VS Code.
- Environment Issues: Ensure you're using the correct Python environment with all dependencies installed.
- Permission Errors: Make sure your bot has the necessary permissions in the Discord server.
- Batch File Issues:
- If the batch file can't find conda, make sure Anaconda/Miniconda is properly installed and added to PATH
- If environment activation fails, verify the environment name matches what you created
- Run the batch file as Administrator if you encounter permission issues
If your run_bot.bat
doesn't work:
-
Conda not found: Add conda to your system PATH or use the full path:
call "C:\Users\YourUsername\miniconda3\Scripts\activate.bat" discord-bot
-
Environment name mismatch: Make sure your environment name matches:
conda info --envs # Check your environment names
-
Script location: Ensure the batch file is in the same folder as
discord_bot.py
If you encounter issues:
- Check that all dependencies are installed correctly
- Verify your bot token and server settings
- Ensure the bot has appropriate permissions in your Discord server
- Check the console for error messages
This is my first Discord bot project, so improvements and suggestions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
MIT License
- Thanks to the MC Server Soft team for creating an excellent Minecraft server wrapper
- Thanks to the Discord.py community for excellent documentation
- Minecraft server status checking community for inspiration