Latest develop version enabled OnGrab button for custom scripts, here is a simple notification.
#!/bin/sh
TOKEN='TELEGRAM_TOKEN'
URL='https://api.telegram.org/bot'$TOKEN
MSG_URL=$URL'/sendMessage?chat_id='
UPD_URL=$URL'/getUpdates?offset='
send_telegram_message () {
curl -s --data-urlencode "text=$2" --data-urlencode "parse_mode=Markdown" "$MSG_URL$1&"
}
generate_message () {
case $sonarr_eventtype in
Grab)
size=$( expr "${sonarr_release_size}" / 1048576 )
msg=$(printf "*Episode Grabbed* \n*Source:* ${sonarr_release_title} | ${size} MB \n*Indexer:* ${sonarr_release_indexer}")
;;
Download)
size=$( expr `stat -c "%s" "${sonarr_episodefile_path}"` / 1048576 )
msg=$(printf "*Episode Imported* \n*Source:* ${sonarr_episodefile_scenename} | ${size} MB \n*Destination:* ${sonarr_episodefile_path} ")
send_message "13611883" "$msg"
;;
esac
}
generate_message
send_telegram_message "110642629" "${msg}"
Edit: I changed the script to something that can be used in both cases grab/download.
note that if you have in your indexer name with an underscore character like “_” (example speedcd_HD) the message on grab will fail, because underscore gets parsed as markdown character, so change underscores to something else