Release 1.0.0
This commit is contained in:
+154
-44
@@ -1,65 +1,175 @@
|
||||
# Quick Start Guide
|
||||
|
||||
## 1️⃣ Installation
|
||||
## 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}
|
||||
```
|
||||
|
||||
Placeholders: {version}, {release_date}, {type}
|
||||
|
||||
See WIKI_CONFIG.md for complete examples.
|
||||
|
||||
## Testing
|
||||
|
||||
### Manual Version Checker Test
|
||||
|
||||
```bash
|
||||
cd d:\Git Repos\MinecraftUpdates
|
||||
pip install -r requirements.txt
|
||||
python -c "from minecraft_checker import get_latest_releases; import json; print(json.dumps(get_latest_releases(['release']), indent=2))"
|
||||
```
|
||||
|
||||
## 2️⃣ Reddit Setup
|
||||
1. Go to https://www.reddit.com/prefs/apps
|
||||
2. Click "Create an app" (type: Script)
|
||||
3. Get your credentials: Client ID, Client Secret
|
||||
### Bedrock Checker Test
|
||||
|
||||
## 3️⃣ Configure
|
||||
Edit `config.py`:
|
||||
```python
|
||||
REDDIT_CLIENT_ID = "your_client_id"
|
||||
REDDIT_CLIENT_SECRET = "your_client_secret"
|
||||
REDDIT_USERNAME = "your_username"
|
||||
REDDIT_PASSWORD = "your_password"
|
||||
SUBREDDIT = "your_subreddit"
|
||||
```bash
|
||||
python -c "from bedrock_checker import get_latest_bedrock_release; import json; result = get_latest_bedrock_release(); print(json.dumps(result, indent=2))"
|
||||
```
|
||||
|
||||
## 4️⃣ Test
|
||||
### Full Configuration Test
|
||||
|
||||
```bash
|
||||
python test_setup.py
|
||||
```
|
||||
|
||||
Should show:
|
||||
- ✓ Configuration checked
|
||||
- ✓ Minecraft API working
|
||||
- ✓ Reddit connection working
|
||||
Expected output:
|
||||
- Configuration loaded successfully
|
||||
- Minecraft API reachable
|
||||
- Reddit connection working
|
||||
- Wiki configuration loaded
|
||||
|
||||
## 5️⃣ Run
|
||||
## 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:
|
||||
```bash
|
||||
python main.py
|
||||
docker-compose logs -f
|
||||
```
|
||||
|
||||
See posts appear in your subreddit automatically!
|
||||
|
||||
---
|
||||
|
||||
## Optional Config Changes
|
||||
|
||||
### Check for Snapshots Too
|
||||
```python
|
||||
RELEASE_TYPES = ["release", "snapshot"]
|
||||
Manual:
|
||||
```
|
||||
Watch console output for [BOT], [CHAT], [BEDROCK_CHECKER] messages
|
||||
```
|
||||
|
||||
### Check More Frequently (testing)
|
||||
```python
|
||||
CHECK_INTERVAL = 600 # 10 minutes instead of 1 hour
|
||||
```
|
||||
## Common Issues
|
||||
|
||||
### Customize Post Format
|
||||
Edit the `POST_TEMPLATE` in `config.py` - it uses `{version}` and `{release_date}` placeholders.
|
||||
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
|
||||
|
||||
## Files Overview
|
||||
- `main.py` - The bot itself
|
||||
- `config.py` - Settings (edit this!)
|
||||
- `minecraft_checker.py` - Fetches Minecraft version data
|
||||
- `test_setup.py` - Tests your configuration
|
||||
- `DB/` - Stores tracking of posted versions (auto-created)
|
||||
Wiki config not loading:
|
||||
- Verify wiki page name is exactly "minecraft_update_bot"
|
||||
- Ensure YAML syntax is valid
|
||||
|
||||
Reference in New Issue
Block a user