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. # 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. # 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 URL='https://api.telegram.org/bot'$TOKEN
FORWARD_URL=$URL'/forwardMessage' FORWARD_URL=$URL'/forwardMessage'
@ -199,10 +199,12 @@ process_client() {
copid="$(cat $copidname 2>/dev/null)" copid="$(cat $copidname 2>/dev/null)"
if [ "$copid" = "" ]; then if [ "$copid" = "" ]; then
[ "${URLS[*]}" != "" ] && {
curl -s ${URLS[*]} -o $NAME curl -s ${URLS[*]} -o $NAME
send_file "${USER[ID]}" "$NAME" "$CAPTION" send_file "${USER[ID]}" "$NAME" "$CAPTION"
rm "$NAME" rm "$NAME"
send_location "${USER[ID]}" "${LOCATION[LATITUDE]}" "${LOCATION[LONGITUDE]}" }
[ "${LOCATION[*]}" != "" ] && send_location "${USER[ID]}" "${LOCATION[LATITUDE]}" "${LOCATION[LONGITUDE]}"
case $MESSAGE in case $MESSAGE in
'/question') '/question')
startproc& 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 Contribute to the project: https://github.com/topkecleon/telegram-bot-bash
" "
;; ;;
'')
;;
*) *)
send_message "${USER[ID]}" "$MESSAGE" send_message "${USER[ID]}" "$MESSAGE"
esac esac