2019-12-11 04:43:53 +03:00
|
|
|
send_telegram_message() {
|
|
|
|
if [[ -z $TELEGRAM_BOT_KEY ]]; then
|
|
|
|
return;
|
|
|
|
fi
|
|
|
|
if ! command -v curl >/dev/null; then
|
|
|
|
return;
|
|
|
|
fi
|
2020-01-11 03:39:22 +03:00
|
|
|
local TEXT=${1//\"/\\\"}
|
2019-12-11 04:43:53 +03:00
|
|
|
curl --silent \
|
|
|
|
-X POST \
|
|
|
|
-H 'Content-Type: application/json' \
|
2020-04-20 14:24:18 +03:00
|
|
|
-d '{"disable_web_page_preview": true, "chat_id": "-1001225613794", "parse_mode": "html", "text": "'"$TEXT"'", "disable_notification": false}' \
|
2021-08-07 15:32:18 +03:00
|
|
|
https://api.telegram.org/bot"$TELEGRAM_BOT_KEY"/sendMessage >/dev/null
|
2019-12-11 04:43:53 +03:00
|
|
|
}
|