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
+7 -3
View File
@@ -7,10 +7,10 @@ import json
import re
import yaml
from typing import Dict, Optional, Tuple
import config
# Cache TTL in seconds (refresh wiki config every 30 minutes)
WIKI_CACHE_TTL = 1800
WIKI_PAGE_NAME = "minecraft_update_bot"
class WikiConfig:
@@ -72,7 +72,10 @@ class WikiConfig:
"""
try:
subreddit = self.reddit.subreddit(self.subreddit_name)
wiki_page = subreddit.wiki[WIKI_PAGE_NAME]
print(f"[WIKI_CONFIG] Attempting to fetch wiki page: {config.WIKI_PAGE_NAME}")
# Try the wiki page with the configured name
wiki_page = subreddit.wiki[config.WIKI_PAGE_NAME]
content = wiki_page.content_md
self.configs = self._parse_yaml_content(content)
@@ -88,7 +91,8 @@ class WikiConfig:
return False
except Exception as e:
print(f"[WIKI_CONFIG] ✗ Error fetching wiki: {e}")
print(f"[WIKI_CONFIG] ✗ Error fetching wiki page '{config.WIKI_PAGE_NAME}' from r/{self.subreddit_name}: {e}")
print(f"[WIKI_CONFIG] ⚠ Check that the page exists at reddit.com/r/{self.subreddit_name}/wiki/{config.WIKI_PAGE_NAME}")
return False
def _parse_yaml_content(self, content: str) -> Dict[str, Dict[str, str]]: