Release 1.0.0

This commit is contained in:
2026-03-12 21:45:01 +00:00
parent 28be3105b6
commit b2a9f74f59
12 changed files with 1028 additions and 522 deletions
+234 -140
View File
@@ -1,202 +1,296 @@
# Wiki Configuration Setup
# Wiki Configuration Guide
The Minecraft Update Bot uses a subreddit wiki page to store customizable post templates. This allows you to configure different post formats for different release types (releases, snapshots, etc.) without restarting the bot.
The Minecraft Update Bot uses a subreddit wiki page to manage customizable post templates. This allows different post formats for different release types without restarting the bot.
## Quick Setup
1. **Create the wiki page on your subreddit**
- Go to your subreddit settings
- Navigate to "Edit wiki page"
- Create a new page named `minecraft_update_bot`
1. Go to your subreddit settings and edit wiki pages
2. Create a new page named "minecraft_update_bot"
3. Add YAML configuration for your post templates
4. Bot loads the configuration automatically
2. **Add the configuration in YAML format**
The wiki page name can be customized via the REDDIT_WIKI_PAGE_NAME environment variable.
Copy and paste the following into your wiki page:
## Configuration Format
The wiki page must contain valid YAML with this structure:
```yaml
release_type:
title: "Post title with placeholders"
body: |
Post body content
with {placeholders}
```
## Available Placeholders
Both title and body can use these placeholders:
- {version} - The release version number (e.g., "1.21", "26.3")
- {release_date} - Formatted release date (e.g., "June 13, 2024")
- {type} - The release type (e.g., "release", "snapshot")
## Release Types
Create configuration sections for these release types:
Java Edition:
- release - Final Java Edition releases
- snapshot - Development snapshots
- old_beta - Legacy beta versions
- old_alpha - Legacy alpha versions
Bedrock Edition:
- bedrock-windows - Bedrock Edition
Special:
- default - Fallback for unconfigured types
## Example Configurations
### Basic Setup (Releases Only)
```yaml
release:
title: "Minecraft {version} Released!"
title: "Minecraft {version} is Available"
body: |
# Minecraft {version} Released
A new version of Minecraft Java Edition is available!
A new version of Minecraft Java Edition is now available!
Version: {version}
Released: {release_date}
**Version:** {version}
**Released:** {release_date}
Download from minecraft.net or use the Minecraft launcher.
```
### Multiple Release Types
```yaml
release:
title: "Minecraft {version} Released"
body: |
# Minecraft {version}
Download it from [minecraft.net](https://minecraft.net) or use the Minecraft launcher.
A new release is available!
Version: {version}
Released: {release_date}
Download: https://minecraft.net
snapshot:
title: "Minecraft {version} Snapshot Available"
title: "Minecraft {version} Snapshot"
body: |
# Minecraft {version} Snapshot
A new snapshot is available for testing!
A new development snapshot is available for testing.
**Version:** {version}
**Released:** {release_date}
Version: {version}
Released: {release_date}
Try it in the launcher with the development profiles.
Enable snapshots in your launcher preferences.
bedrock-windows:
title: "Minecraft Bedrock Edition {version} Available (Windows)"
title: "Bedrock Edition {version} Available"
body: |
# Minecraft Bedrock Edition {version}
A new version is available for Windows!
A new Bedrock Edition update is available for Windows.
**Version:** {version}
**Released:** {release_date}
Version: {version}
Released: {release_date}
Download from the Microsoft Store or via the Minecraft Launcher.
Download from the Microsoft Store or through the Minecraft Launcher.
old_beta:
title: "Minecraft Beta {version} Archive"
body: |
Version {version} is now archived.
Released: {release_date}
old_alpha:
title: "Minecraft Alpha {version} Archive"
body: |
Version {version} is now archived.
Released: {release_date}
default:
title: "Minecraft {version} ({type})"
body: |
# Minecraft {version}
A new {type} build has been released!
**Version:** {version}
**Released:** {release_date}
```
3. **Save the wiki page**
- The bot will automatically load this config on startup
- Changes to the wiki are refreshed every 30 minutes
## Configuration Format
The wiki page must be valid YAML with this structure:
```yaml
release_type:
title: "Post title with {placeholders}"
body: |
Multi-line post body
with {placeholders}
```
### Available Placeholders
In both title and body, you can use:
- `{version}` - The Minecraft version (e.g., "1.21")
- `{release_date}` - The formatted release date (e.g., "June 13, 2024")
- `{type}` - The release type (e.g., "release", "snapshot")
### Release Types
Create sections for each release type you want custom posts for:
- `release` - Java Edition final releases
- `snapshot` - Java Edition snapshots
- `old_beta` - Java Edition old beta versions
- `old_alpha` - Java Edition old alpha versions
- `bedrock-windows` - Bedrock Edition (Windows)
- `default` - Fallback for any unconfigured type
## Examples
### Example 1: Simple Setup (Releases Only)
```yaml
release:
title: "Minecraft {version} is Out!"
body: |
{version} is available now!
Get it at minecraft.net
```
### Example 2: Different Templates per Type
```yaml
release:
title: "🎉 Minecraft {version} Released"
body: |
# Minecraft {version}
The full release is here!
**Download:** [minecraft.net](https://minecraft.net)
**Date:** {release_date}
snapshot:
title: "📸 Minecraft {version} Snapshot"
body: |
# Snapshot Available
Test drive {version} before the official release!
**Date:** {release_date}
old_beta:
title: "[LEGACY] Minecraft {version} Beta"
body: |
Archive: Minecraft {version} beta
New {type} build: {version}
Released: {release_date}
```
### Example 3: Minimal Setup with Default
### Minimal Setup with Defaults
```yaml
default:
title: "Minecraft {version}"
body: |
New {type}: {version}
{release_date}
# New {type} Available
Version: {version}
Released: {release_date}
```
## Features
## Loading and Caching
- **Multiple Configurations:** Different posts for releases, snapshots, legacy versions, etc.
- **Auto-Refresh:** Wiki changes are loaded every 30 minutes automatically
- **Fallback:** If a release type isn't configured, it uses the `default` config
- **No Restart Required:** Changes take effect on the next check cycle
- **Flexible:** Use any text, formatting, and placeholders you want
The wiki configuration:
- Loads on bot startup
- Refreshes automatically during version checks
- Is cached for 5 minutes to avoid excessive wiki requests
- Falls back to embedded defaults if the wiki page is missing or invalid
Warning messages in logs:
- "Error fetching YAML config from wiki" - Cannot read the page
- "Wiki config missing required 'triggers' key" - Invalid YAML format
- An error YAML parse message - Syntax error in configuration
## Formatting Guidelines
YAML syntax rules:
- Use correct indentation (2 spaces recommended)
- Start multi-line strings with | or |-
- Values in double quotes: "string with special characters"
- No tab characters (spaces only)
Text formatting in posts:
- Standard Reddit Markdown supported
- Headers: # Title (single hash for main title)
- Bold: **text**
- Italic: *text*
- Links: [text](url)
- Line breaks: Use actual newlines in the YAML body
## Fallback Behavior
If a release type is not configured:
1. Bot looks for a "default" section
2. If no default exists, uses embedded defaults
3. Embedded default format:
```
Title: Minecraft {version} ({type})
Body: New {type}: {version}. Released: {release_date}
```
## YAML Validation
Test your YAML before adding to wiki:
- Use an online YAML validator at https://www.yamllint.com/
- Check for correct indentation and quotes
- Verify all colons have spaces after them
Common mistakes:
- Indentation with tabs (must be spaces)
- Missing quotes around values with special characters
- Unbalanced quotes
- Trailing colons without values
## Testing Configuration
After updating the wiki page:
1. Send a "reload-config" chat message to the bot (moderators only)
2. Check bot logs for these messages:
- "[WIKI_CONFIG] Successfully fetched wiki page"
- "[WIKI_CONFIG] Loaded X configuration(s)"
3. Look for error messages with parsing details
Command for moderators:
```
Send a Reddit chat message to the bot containing: reload-config
```
The bot will reply with success or failure status.
## Troubleshooting
### Configuration Not Loading
Wiki configuration not loading:
1. Check page name is exactly "minecraft_update_bot" (or your custom name)
2. Verify the bot can read the wiki (check subreddit permissions)
3. Use YAML validator to find syntax errors
4. Check bot logs for error messages
1. Check the bot logs:
```bash
docker-compose logs minecraft-bot
```
Posts not formatting correctly:
- Verify placeholder names: {version}, {release_date}, {type}
- Check YAML indentation is consistent
- Use | for multi-line bodies (not single quotes)
- Test problematic sections in a YAML validator
2. Verify the wiki page name is exactly `minecraft_update_bot`
Configuration not updating after wiki change:
- Wait up to 5 minutes (cache timeout)
- Or send "reload-config" chat command (moderators)
- Check bot logs to confirm reload was successful
3. Ensure the YAML is valid (use a YAML validator if needed)
Fallback config triggering:
- Check for YAML parse errors in logs
- Verify the wiki page is readable
- Ensure "release" configuration exists or "default" is defined
4. Check that the bot has permissions to read the wiki
## Examples with Real-World Scenarios
### Posts Not Formatting Correctly
### Example 1: Simple Release Announcements
- Verify placeholder names are correct: `{version}`, `{release_date}`, `{type}`
- Check that the YAML syntax is correct (indentation matters!)
- Use the pipe `|` for multi-line bodies
### Reverting to Default
If the wiki page is empty or invalid, the bot will use embedded defaults:
For a subreddit that only posts final releases:
```yaml
release:
title: "Minecraft {version} Released!"
body: "# Minecraft {version}\n\nA new version is available!\n\n**Version:** {version}\n**Released:** {release_date}\n\nGet it at [minecraft.net](https://minecraft.net)"
title: "Minecraft {version} - Out Now!"
body: |
The official release of Minecraft {version} is now available!
Released: {release_date}
```
## Advanced: Testing Your Configuration
### Example 2: Community-Focused Posts
To test without posting to your subreddit:
```yaml
release:
title: "What's New in Minecraft {version}?"
body: |
# Minecraft {version} Released
We have a new version!
**Version:** {version}
**Release Date:** {release_date}
What are you most excited to try?
1. View the bot logs:
```bash
docker-compose logs -f
```
snapshot:
title: "Snapshot: Try the Latest Features"
body: |
# {version} Snapshot Available
Want to test upcoming features? This is your chance!
Released: {release_date}
Remember: Snapshots can be unstable. Use separate worlds for testing!
```
2. Watch for the line:
```
[WIKI_CONFIG] ✓ Loaded X configuration(s)
```
### Example 3: Structured with Emojis (if preferred)
```yaml
release:
title: "[RELEASE] Minecraft {version}"
body: |
Minecraft {version} is now available!
Released: {release_date}
snapshot:
title: "[SNAPSHOT] Minecraft {version}"
body: |
New snapshot available!
Released: {release_date}
```
## Wiki Markup
Reddit wiki pages support:
- Standard Markdown
- Escape special characters with backslash: \{text\}
- HTML not processed in wiki pages
- Some Reddit-specific formatting may have limitations
3. This confirms your configs were loaded successfully