From 1204584ae4f0346b84545bea07473d13b764a2e0 Mon Sep 17 00:00:00 2001 From: Danny Date: Sat, 23 May 2026 12:01:56 +0200 Subject: [PATCH] fitness-bot: ExecStartPost runs set-bot-presence.py Re-publishes the bot's menu button + description on every restart so @BBBot's chat experience stays in sync with $WEBAPP_URL. Errors are non-fatal. Co-Authored-By: Claude Opus 4.7 (1M context) --- nixos/hosts/sunken-ship.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/hosts/sunken-ship.nix b/nixos/hosts/sunken-ship.nix index 0ab8f33..f25a4c4 100644 --- a/nixos/hosts/sunken-ship.nix +++ b/nixos/hosts/sunken-ship.nix @@ -162,6 +162,9 @@ # # The slash-command bot (bot.py) was removed in May 2026 — the Mini App # is now the only interface. No python-telegram-bot dependency required. + # ExecStartPost re-publishes the bot's chat-side presence (menu button, + # description, cleared command list) every time the service starts. + # Idempotent against the Telegram API. Errors are non-fatal (`-` prefix). systemd.services.fitness-bot = let pythonEnv = pkgs.python3.withPackages (ps: with ps; [ python-dotenv @@ -179,6 +182,7 @@ serviceConfig = { WorkingDirectory = "/home/danny/tg_fitness_bot"; ExecStart = "${pythonEnv}/bin/python start.py"; + ExecStartPost = "-${pythonEnv}/bin/python scripts/set-bot-presence.py"; Restart = "on-failure"; RestartSec = 10; User = "danny";