3.9 KiB
3.9 KiB
Quick Start Guide
Installation
Docker (Recommended)
-
Copy environment template:
copy .env.example .env -
Edit
.envwith credentials:REDDIT_CLIENT_ID=your_client_id REDDIT_CLIENT_SECRET=your_client_secret REDDIT_USERNAME=your_username REDDIT_PASSWORD=your_password SUBREDDIT=your_subreddit -
Start the bot:
docker-compose up -d -
Check logs:
docker-compose logs -f
Manual Installation
-
Install dependencies:
pip install -r requirements.txt -
Create Reddit app at https://www.reddit.com/prefs/apps (select "Script" type)
-
Set environment variables:
set REDDIT_CLIENT_ID=your_client_id set REDDIT_CLIENT_SECRET=your_client_secret set REDDIT_USERNAME=your_username set REDDIT_PASSWORD=your_password set SUBREDDIT=your_subreddit -
Run the bot:
python main.py
Configuration
Required env vars:
- REDDIT_CLIENT_ID
- REDDIT_CLIENT_SECRET
- REDDIT_USERNAME
- REDDIT_PASSWORD
- SUBREDDIT
Optional env vars:
- REDDIT_RELEASE_TYPES (default: release)
- Examples: "release", "release,snapshot"
- REDDIT_CHECK_BEDROCK (default: false)
- Set to "true" to enable Bedrock Edition detection
- REDDIT_CHECK_INTERVAL (default: 3600)
- Number of seconds between version checks
- REDDIT_WIKI_PAGE_NAME (default: minecraft_update_bot)
- Wiki page name for post templates
Wiki Configuration
Create a wiki page named minecraft_update_bot on your subreddit with YAML content:
release:
title: "Minecraft {version} Released"
body: |
New version available!
**Version:** {version}
**Released:** {release_date}
snapshot:
title: "Minecraft {version} Snapshot"
body: |
New snapshot available for testing!
**Version:** {version}
**Released:** {release_date}
Placeholders: {version}, {release_date}, {type}
See WIKI_CONFIG.md for complete examples.
Testing
Manual Version Checker Test
python -c "from minecraft_checker import get_latest_releases; import json; print(json.dumps(get_latest_releases(['release']), indent=2))"
Bedrock Checker Test
python -c "from bedrock_checker import get_latest_bedrock_release; import json; result = get_latest_bedrock_release(); print(json.dumps(result, indent=2))"
Full Configuration Test
python test_setup.py
Expected output:
- Configuration loaded successfully
- Minecraft API reachable
- Reddit connection working
- Wiki configuration loaded
Moderator Commands
Send these messages via Reddit chat to control the bot:
reload-config
- Reloads wiki configuration without restarting
- Usage: Send a chat message containing "reload-config"
repost-latest
- Manually repost latest versions (bypasses duplicate check)
- Usage: Send a chat message containing "repost-latest"
Note: Only subreddit moderators can use these commands.
File Overview
- main.py - Bot orchestration and command handler
- config.py - Configuration loader
- minecraft_checker.py - Java Edition version checker
- bedrock_checker.py - Bedrock Edition version checker
- wiki_config.py - Wiki configuration manager
- update_checker.py - Bot update checker
- requirements.txt - Python dependencies
- Dockerfile - Container image
- docker-compose.yml - Docker composition
- DB/ - Version tracking database
Logs
Docker:
docker-compose logs -f
Manual:
Watch console output for [BOT], [CHAT], [BEDROCK_CHECKER] messages
Common Issues
No posts appearing:
- Check logs for errors
- Verify subreddit name in REDDIT_SUBREDDIT
- Check DB/posted_versions.json for version tracking
Bot not detecting Bedrock:
- Ensure REDDIT_CHECK_BEDROCK is set to true
- Check bedrock_checker logs for wiki scraping errors
Wiki config not loading:
- Verify wiki page name is exactly "minecraft_update_bot"
- Ensure YAML syntax is valid