- **CHECK_INTERVAL:** How often to check for updates (in seconds)
- Default: 3600 (1 hour)
- **POST_TEMPLATE:** Customize the post format
Examples:
```python
# Check for both releases and snapshots
RELEASE_TYPES = ["release", "snapshot"]
# Check every 30 minutes
CHECK_INTERVAL = 1800
# Check every 10 minutes (for testing)
CHECK_INTERVAL = 600
```
### 5. Run the Bot
```bash
python main.py
```
You should see output like:
```
[BOT] Starting Minecraft Update Bot...
[BOT] ✓ Successfully connected to Reddit
[BOT] Started update checker (checking every 3600 seconds)
[BOT] ✓ Bot is running
```
## Automatic Update Notifications
The bot includes an update checker that periodically polls for new versions and notifies your subreddit's modteam via modmail when updates are available.
**How it works:**
- Checks `https://updts.slfhstd.uk` every hour for new versions
- Sends modmail to your subreddit's modteam if an update is found
- Limits notifications to once per 24 hours to avoid spam
- No configuration needed - it runs automatically!
**What you'll see:**
```
[UPDATE_CHECKER] Started for MinecraftUpdateBot v1.0
[UPDATE_CHECKER] Update found: 1.0 -> 1.1
[UPDATE_CHECKER] Sent update notification to r/your_subreddit
```
The modteam will receive a message with the new version number and changelog link.
## How It Works
1. **Initialization:** Bot connects to Reddit and loads posted versions from `DB/posted_versions.json`
2. **Check Loop:** Every CHECK_INTERVAL seconds, it:
- Fetches the latest Minecraft versions from Mojang's launcher manifest
- Checks if any are new (not in `DB/posted_versions.json`)
- Posts to subreddit if new versions found
- Saves the posted version IDs
3. **Background:** Runs in background thread, checking continuously
## Database
Posted versions are stored in `DB/posted_versions.json`:
```json
{
"posted": [
"1.20.1",
"1.21",
"1.21.1"
]
}
```
To reset (post all new versions again), delete or clear this file.
## Troubleshooting
### Connection Issues
- Check your credentials in `config.py` or environment variables
- Verify your Reddit app is configured correctly
- Make sure your Reddit account can post to the subreddit
### "No New Releases"
- The bot only posts once per version
- Check `DB/posted_versions.json` to see what's been posted
- Delete a version from the file to repost it
### Test with Snapshots
Change `RELEASE_TYPES = ["snapshot"]` and `CHECK_INTERVAL = 60` to test quickly.
## Files
- `main.py` - Main bot script
- `config.py` - Configuration
- `minecraft_checker.py` - Fetches version data from Mojang