1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

chore: format

This commit is contained in:
2022-03-13 10:31:19 +01:00
parent 730070bc9d
commit a4d002e293
11 changed files with 153 additions and 150 deletions

View File

@@ -14,16 +14,16 @@ with lib; let
serviceConfig.Type = "oneshot";
wants = ["network-online.target"];
script = strings.concatStringsSep "\n" (["QUOTE=$(${bot.command})" "if [ -n \"$QUOTE\" ]; then"]
++ map (chatId: ''
${pkgs.curl}/bin/curl -s -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}"
}
'')
bot.chatIds
++ ["fi"]);
++ map (chatId: ''
${pkgs.curl}/bin/curl -s -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}"
}
'')
bot.chatIds
++ ["fi"]);
};
in {
options.niveum.telegramBots = mkOption {