-
V2.1.0 Stable
released this
2026-03-11 21:07:14 +00:00 | 0 commits to main since this releaseVersion 2.1.0 - Update Checker System
New Features
1. Update Checker System
- Bot now periodically checks for new versions from a centralized update server
- Automatically sends modmail notifications to subreddit modteam when updates are available
- Includes changelog URL in notification for easy reference
- 24-hour cooldown prevents spam (max 1 notification per day)
- Runs as a background daemon thread alongside main bot operations
- Tracks last update notification timestamp to file for persistence across restarts
2. Version Management
- Bot version is now centralized at the top of
bot.pyin a dedicated section BOT_VERSIONandBOT_NAMEconstants used throughout the bot- Easy single-location reference for version updates
- Version automatically included in update checker calls and user agent string
3. Infrastructure
- Created separate
update_server/project for version management service - Flask-based REST API serving version information via
/api/version/<bot_name> versions.jsonfile stores version details for all bots- Docker support with Dockerfile for containerized deployment
- Includes comprehensive README with deployment options
New Files
- update_checker.py - Background module that checks for and notifies about updates
Modified Files
bot.py
- Added version constants section at top for easy reference
- Added import for
update_checkermodule - Added
start_update_checker()call inmain()function - User agent now uses version constants:
{BOT_NAME}/{BOT_VERSION}
requirements.txt
- Added
requestslibrary for HTTP requests to update server
docker-compose.yml
- Volume mounts for persistent
versions.jsonand log files
Configuration
Update checker timing is configurable in
update_checker.py:UPDATE_CHECK_INTERVAL = 60seconds (check frequency)UPDATE_COOLDOWN = 86400seconds (24 hours between notifications)
How It Works
- On startup, bot creates background thread running update checker
- Every hour, thread polls
https://updts.slfhstd.uk/api/version/TestPostsBot - If version differs from current
BOT_VERSION, and 24 hours have passed since last notification, sends modmail - Modmail includes current version, available version, and changelog URL
- Last notification timestamp stored in
DB/.last_update_check.txt
Downloads