Removed token and added checks

This commit is contained in:
Daniil Gentili 2016-01-19 20:32:29 +01:00
parent 329b248987
commit 89fdfdf14b

View File

@ -12,7 +12,7 @@
# This file is public domain in the USA and all free countries.
# If you're in Europe, and public domain does not exist, then haha.
TOKEN='179533649:AAHR470oLFSDD8WXy8L87uZFofxM6IDp5oU'
TOKEN='tokenhere'
URL='https://api.telegram.org/bot'$TOKEN
FORWARD_URL=$URL'/forwardMessage'
@ -199,10 +199,12 @@ process_client() {
copid="$(cat $copidname 2>/dev/null)"
if [ "$copid" = "" ]; then
[ "${URLS[*]}" != "" ] && {
curl -s ${URLS[*]} -o $NAME
send_file "${USER[ID]}" "$NAME" "$CAPTION"
rm "$NAME"
send_location "${USER[ID]}" "${LOCATION[LATITUDE]}" "${LOCATION[LONGITUDE]}"
}
[ "${LOCATION[*]}" != "" ] && send_location "${USER[ID]}" "${LOCATION[LATITUDE]}" "${LOCATION[LONGITUDE]}"
case $MESSAGE in
'/question')
startproc&
@ -224,6 +226,8 @@ Written by @topkecleon, Juan Potato (@awkward_potato), Lorenzo Santina (BigNerd9
Contribute to the project: https://github.com/topkecleon/telegram-bot-bash
"
;;
'')
;;
*)
send_message "${USER[ID]}" "$MESSAGE"
esac