Files
MinecraftUpdates/QUICKSTART.md
T

176 lines
3.9 KiB
Markdown
Raw Permalink Normal View History

2026-03-11 23:24:42 +00:00
# Quick Start Guide
2026-03-12 21:45:01 +00:00
## Installation
### Docker (Recommended)
1. Copy environment template:
```bash
copy .env.example .env
```
2. Edit `.env` with credentials:
```
REDDIT_CLIENT_ID=your_client_id
REDDIT_CLIENT_SECRET=your_client_secret
REDDIT_USERNAME=your_username
REDDIT_PASSWORD=your_password
SUBREDDIT=your_subreddit
```
3. Start the bot:
```bash
docker-compose up -d
```
4. Check logs:
```bash
docker-compose logs -f
```
### Manual Installation
1. Install dependencies:
```bash
pip install -r requirements.txt
```
2. Create Reddit app at https://www.reddit.com/prefs/apps (select "Script" type)
3. Set environment variables:
```bash
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
```
4. Run the bot:
```bash
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:
```yaml
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}
2026-03-11 23:24:42 +00:00
```
2026-03-12 21:45:01 +00:00
Placeholders: {version}, {release_date}, {type}
See WIKI_CONFIG.md for complete examples.
## Testing
### Manual Version Checker Test
```bash
python -c "from minecraft_checker import get_latest_releases; import json; print(json.dumps(get_latest_releases(['release']), indent=2))"
2026-03-11 23:24:42 +00:00
```
2026-03-12 21:45:01 +00:00
### Bedrock Checker Test
2026-03-11 23:24:42 +00:00
```bash
2026-03-12 21:45:01 +00:00
python -c "from bedrock_checker import get_latest_bedrock_release; import json; result = get_latest_bedrock_release(); print(json.dumps(result, indent=2))"
2026-03-11 23:24:42 +00:00
```
2026-03-12 21:45:01 +00:00
### Full Configuration Test
2026-03-11 23:24:42 +00:00
```bash
2026-03-12 21:45:01 +00:00
python test_setup.py
2026-03-11 23:24:42 +00:00
```
2026-03-12 21:45:01 +00:00
Expected output:
- Configuration loaded successfully
- Minecraft API reachable
- Reddit connection working
- Wiki configuration loaded
## Moderator Commands
2026-03-11 23:24:42 +00:00
2026-03-12 21:45:01 +00:00
Send these messages via Reddit chat to control the bot:
2026-03-11 23:24:42 +00:00
2026-03-12 21:45:01 +00:00
**reload-config**
- Reloads wiki configuration without restarting
- Usage: Send a chat message containing "reload-config"
2026-03-11 23:24:42 +00:00
2026-03-12 21:45:01 +00:00
**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:
```bash
docker-compose logs -f
2026-03-11 23:24:42 +00:00
```
2026-03-12 21:45:01 +00:00
Manual:
2026-03-11 23:24:42 +00:00
```
2026-03-12 21:45:01 +00:00
Watch console output for [BOT], [CHAT], [BEDROCK_CHECKER] messages
```
## Common Issues
2026-03-11 23:24:42 +00:00
2026-03-12 21:45:01 +00:00
No posts appearing:
- Check logs for errors
- Verify subreddit name in REDDIT_SUBREDDIT
- Check DB/posted_versions.json for version tracking
2026-03-11 23:24:42 +00:00
2026-03-12 21:45:01 +00:00
Bot not detecting Bedrock:
- Ensure REDDIT_CHECK_BEDROCK is set to true
- Check bedrock_checker logs for wiki scraping errors
2026-03-11 23:24:42 +00:00
2026-03-12 21:45:01 +00:00
Wiki config not loading:
- Verify wiki page name is exactly "minecraft_update_bot"
- Ensure YAML syntax is valid