nix/home/program/bash/module/Notify.nix
2024-10-12 15:57:45 +03:00

17 lines
474 B
Nix

{ secret, ... }:
{
text = ''
# Send Telegram notification.
# Usage: notify <MESSAGE>
function notify() {
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 "${secret.tg.dt "true"}" ${secret.tg.bt} &> /dev/null
}
'';
}