Created
June 26, 2016 02:51
-
-
Save HelloKS/8d90f29ef4690762506ba39583ebb614 to your computer and use it in GitHub Desktop.
Telegram alert for deluge execute plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Telegram alert for deluge execute plugin | |
TORRENT_ID=$1 | |
TORRENT_NAME=$2 | |
TORRENT_PATH=$3 | |
TOKEN='Your Telegram token ID here' | |
URL='https://api.telegram.org/bot'$TOKEN | |
MSG_URL=$URL'/sendMessage' | |
TG_ID="Your Telegram user ID here (numberic 8 digit)" | |
RST_URL=$MSG_URL$TG_ID | |
TEMPLATE="[Download Finished] Just finished downloading $TORRENT_NAME." | |
# Function for send Telegram message to user | |
function send_message { | |
curl --silent -output /dev/null \ | |
--data-urlencode "chat_id=${TG_ID}" \ | |
--data-urlencode "text=${TEMPLATE}" \ | |
$MSG_URL | |
} | |
send_message |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Need proper permission (chmod +x tg.sh), curl installed on system.