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:
@@ -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}"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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";
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user