feat: telegram bot improvements (#16)

- Send startup notification when telegram service starts
- Use generic "Service" messages (works for both/single backend)
This commit is contained in:
SamNet-dev
2026-02-04 18:15:14 -06:00
parent 0d8796929b
commit a92f4b4b03

View File

@@ -4751,10 +4751,10 @@ except: pass
case "$cmd" in case "$cmd" in
/status) send_message "$(build_report)" ;; /status) send_message "$(build_report)" ;;
/health) send_message "$(/usr/local/bin/paqctl health 2>&1 | head -30)" ;; /health) send_message "$(/usr/local/bin/paqctl health 2>&1 | head -30)" ;;
/restart) /usr/local/bin/paqctl restart 2>&1; send_message "🔄 paqet restarted" ;; /restart) /usr/local/bin/paqctl restart 2>&1; send_message "🔄 Service restarted" ;;
/stop) /usr/local/bin/paqctl stop 2>&1; send_message "⏹ paqet stopped" ;; /stop) /usr/local/bin/paqctl stop 2>&1; send_message "⏹ Service stopped" ;;
/start) /usr/local/bin/paqctl start 2>&1; send_message "▶️ paqet started" ;; /start) /usr/local/bin/paqctl start 2>&1; send_message "▶️ Service started" ;;
/version) send_message "📦 paqet: ${PAQET_VERSION:-unknown} | paqctl: ${PAQCTL_VERSION:-unknown}" ;; /version) send_message "📦 Version: ${PAQET_VERSION:-unknown} | paqctl: ${PAQCTL_VERSION:-unknown}" ;;
esac esac
done <<< "$cmds" done <<< "$cmds"
fi fi
@@ -4784,6 +4784,9 @@ except: print(0)
fi fi
LAST_UPDATE_ID=${LAST_UPDATE_ID:-0} LAST_UPDATE_ID=${LAST_UPDATE_ID:-0}
# Send startup notification
send_message "🚀 *Telegram notifications started*"$'\n'"Reports every ${TELEGRAM_INTERVAL}h | Alerts: ${TELEGRAM_ALERTS_ENABLED}"
while true; do while true; do
# Reload settings periodically (safe parser, no code execution) # Reload settings periodically (safe parser, no code execution)
_load_settings _load_settings