diff --git a/modules/telegram-bot.nix b/modules/telegram-bot.nix index 5eeb6e1..42d1664 100644 --- a/modules/telegram-bot.nix +++ b/modules/telegram-bot.nix @@ -13,14 +13,14 @@ with lib; let startAt = bot.time; serviceConfig.Type = "oneshot"; wants = ["network-online.target"]; - script = strings.concatStringsSep "\n" (["QUOTE=$(${bot.command})" "if [ -n \"$QUOTE\" ]; then"] + script = strings.concatStringsSep "\n" (["QUOTE=$(${bot.command})" "if [ -n \"$QUOTE\" ]; then" "echo $QUOTE >&2"] ++ map (chatId: '' - ${pkgs.curl}/bin/curl -s -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \ + ${pkgs.curl}/bin/curl -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \ -d chat_id="${chatId}" \ -d text="$QUOTE" ${ lib.strings.optionalString (bot.parseMode != null) "-d parse_mode=${bot.parseMode}" - } + } | ${pkgs.jq}/bin/jq -e .ok '') bot.chatIds ++ ["fi"]);