From 9fcd55ec4bac570b5efdec7b2b05ee4b143d2603 Mon Sep 17 00:00:00 2001 From: Franz Rolfsvaag Date: Sun, 10 Aug 2025 03:58:27 +0200 Subject: [PATCH] 0.0.9 minor verbose fix --- bot.py | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/bot.py b/bot.py index 523da3d..b0e8457 100644 --- a/bot.py +++ b/bot.py @@ -9,6 +9,8 @@ import pathlib import os, asyncio, xml.etree.ElementTree as ET import aiohttp +VERSION="0.0.9" + # ---------- Env & config loading ---------- load_dotenv() @@ -129,39 +131,8 @@ async def _fetch_latest_from_rss(url: str): # ---------- boot notice ---------- async def _post_boot_notice(): - # 1) try build files - commit = None - subject = None - try: - with open("/app/.build_commit", "r") as f: - commit = f.read().strip() - except Exception: - pass - try: - with open("/app/.build_subject", "r") as f: - subject = f.read().strip() - except Exception: - pass - # 2) env fallback - if not commit: - commit = os.getenv("SHAI_BUILD_COMMIT", "").strip() or None - if not subject: - subject = os.getenv("SHAI_BUILD_SUBJECT", "").strip() or None - - # 3) RSS fallback (optional, set SHAI_GIT_RSS to enable; default to your repo) - if (not commit or not subject): - rss_url = os.getenv("SHAI_GIT_RSS", "https://git.rolfsvaag.no/frarol96/shaiwatcher.rss").strip() - if rss_url: - sub2, sha2 = await _fetch_latest_from_rss(rss_url) - subject = subject or sub2 - commit = commit or sha2 - - msg = "Self-update and reboot successful!" - if subject and len(subject) > 5: - msg += f" — {subject}" - if commit: - msg += f" (`{commit}`)" + msg = f"Self-update and reboot successful! (v.{VERSION})" ch_id_raw = bot.config['DEFAULT'].get('modlog_channel_id', '') try: