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

Send the same message to recipients

This commit is contained in:
Kierán Meinhardt
2019-05-01 15:44:04 +02:00
parent 3139bebd0f
commit efe15feab0
2 changed files with 3 additions and 3 deletions

View File

@@ -8,10 +8,10 @@ let
startAt = bot.time; startAt = bot.time;
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
wants = [ "network-online.target" ]; wants = [ "network-online.target" ];
script = strings.concatStringsSep "\n" (map (chatId: '' script = strings.concatStringsSep "\n" (["QUOTE=$(${bot.command})"] ++ map (chatId: ''
${pkgs.curl}/bin/curl -s -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \ ${pkgs.curl}/bin/curl -s -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \
-d chat_id="${chatId}" \ -d chat_id="${chatId}" \
-d text="$(${bot.command})" ${ -d text="$QUOTE" ${
if bot.parseMode == null then "" if bot.parseMode == null then ""
else "-d parse_mode=${bot.parseMode}" else "-d parse_mode=${bot.parseMode}"
} }

View File

@@ -14,7 +14,7 @@ in {
enable = true; enable = true;
time = "08/6:00"; time = "08/6:00";
token = lib.strings.removeSuffix "\n" (builtins.readFile <secrets/telegram-kmein.token>); token = lib.strings.removeSuffix "\n" (builtins.readFile <secrets/telegram-kmein.token>);
chatIds = [ "18980945" ]; chatIds = [ "18980945" "757821027" ];
command = "${pkgs.literature-quote}/bin/literature-quote"; command = "${pkgs.literature-quote}/bin/literature-quote";
parseMode = "Markdown"; parseMode = "Markdown";
}; };