This commit is contained in:
Daniil Gentili 2016-01-22 16:47:58 +01:00
parent 6eca34758f
commit 43c468e336
1 changed files with 4 additions and 2 deletions

View File

@ -70,12 +70,14 @@ send_keyboard() {
local text="$2"
shift 2
local keyboard=init
for f in $*;do local keyboard="$keyboard, [\"$f\"]";done
OLDIFS=$IFS
IFS=$(echo -en "\"")
for f in $*;do [ ! -z "$f" ] && local keyboard="$keyboard, [\"$f\"]";done
IFS=$OLDIFS
local keyboard=${keyboard/init, /}
res=$(curl -s "$MSG_URL" --header "content-type: multipart/form-data" -F "chat_id=$chat" -F "text=$text" -F "reply_markup={\"keyboard\": [$keyboard],\"one_time_keyboard\": true}")
}
get_file() {
[ "$1" != "" ] && echo $FILE_URL$(curl -s "$GET_URL" -F "file_id=$1" | ./JSON.sh -s | egrep '\["result","file_path"\]' | cut -f 2 | cut -d '"' -f 2)