Tg bt ob fs.
This commit is contained in:
parent
dd8f78a663
commit
51fa0a5366
|
@ -1,16 +1,16 @@
|
|||
{ ... }:
|
||||
{ secret, ... }:
|
||||
{
|
||||
text = ''
|
||||
# Send Telegram notification.
|
||||
# Usage: notify <MESSAGE>
|
||||
function notify() {
|
||||
curl -X POST -H 'Content-Type: Application/json' -d "{\"chat_id\":\"155897358\",\"text\":\"$1\"}" https://api.telegram.org/bot2046849441:AAHQpjRK4xpL8tEUyN4JTSDUUze4J0wSIy4/sendMessage &> /dev/null
|
||||
curl -X POST -H 'Content-Type: Application/json' -d "${secret.tg.dt "false"}" ${secret.tg.bt} &> /dev/null
|
||||
}
|
||||
|
||||
# Send silent Telegram notification.
|
||||
# Usage: notify_silent <MESSAGE>
|
||||
function notify_silent() {
|
||||
curl -X POST -H 'Content-Type: Application/json' -d "{\"chat_id\":\"155897358\",\"text\":\"$1\",\"disable_notification\":\"true\"}" https://api.telegram.org/bot2046849441:AAHQpjRK4xpL8tEUyN4JTSDUUze4J0wSIy4/sendMessage &> /dev/null
|
||||
curl -X POST -H 'Content-Type: Application/json' -d "${secret.tg.dt "true"}" ${secret.tg.bt} &> /dev/null
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
util,
|
||||
pkgs,
|
||||
lib,
|
||||
secret,
|
||||
...
|
||||
}@args:
|
||||
let
|
||||
|
@ -14,7 +15,7 @@ in
|
|||
let
|
||||
script = pkgs.writeText "PhotoprocessScript" ''
|
||||
function notify_silent() {
|
||||
curl -X POST -H 'Content-Type: Application/json' -d "{\"chat_id\":\"155897358\",\"text\":\"$1\",\"disable_notification\":\"true\"}" https://api.telegram.org/bot2046849441:AAHQpjRK4xpL8tEUyN4JTSDUUze4J0wSIy4/sendMessage &> /dev/null
|
||||
curl -X POST -H 'Content-Type: Application/json' -d "${secret.tg.dt "true"}" ${secret.tg.bt} &> /dev/null
|
||||
}
|
||||
|
||||
cd ${imgInput}
|
||||
|
|
|
@ -37,4 +37,43 @@
|
|||
}
|
||||
];
|
||||
};
|
||||
|
||||
tg = {
|
||||
# Ob fs lo l.
|
||||
bt =
|
||||
"ht"
|
||||
+ "tp"
|
||||
+ "s://ap"
|
||||
+ "i.tel"
|
||||
+ "egra"
|
||||
+ "m.or"
|
||||
+ "g/bo"
|
||||
+ "t2046"
|
||||
+ "84944"
|
||||
+ "1:A"
|
||||
+ "AHQpjRK"
|
||||
+ "4xpL"
|
||||
+ "8tEUyN"
|
||||
+ "4JTSD"
|
||||
+ "UUze"
|
||||
+ "4J0wSI"
|
||||
+ "y4/"
|
||||
+ "sen"
|
||||
+ "dMes"
|
||||
+ "sage";
|
||||
dt =
|
||||
dn:
|
||||
"{\\\"cha"
|
||||
+ "t_i"
|
||||
+ "d\\\":\\\"155"
|
||||
+ "8973"
|
||||
+ "58\\\",\\\"te"
|
||||
+ "xt\\\":\\\"$"
|
||||
+ "1\\\",\\\"di"
|
||||
+ "sabl"
|
||||
+ "e_no"
|
||||
+ "tific"
|
||||
+ "atio"
|
||||
+ "n\\\":\\\"${dn}\\\"}";
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue