Update commands.sh (#20)

* Update commands.sh

* Update commands.sh

* Update commands.sh

* Update commands.sh

* Update commands.sh
This commit is contained in:
jarriztg 2016-06-05 05:42:20 -05:00 committed by Daniil Gentili
parent d169b7f96f
commit e654ec51ed

View File

@ -16,10 +16,10 @@ else
if ! tmux ls | grep -v send | grep -q $copname; then if ! tmux ls | grep -v send | grep -q $copname; then
[ ! -z ${URLS[*]} ] && { [ ! -z ${URLS[*]} ] && {
curl -s ${URLS[*]} -o $NAME curl -s ${URLS[*]} -o $NAME
send_file "${USER[ID]}" "$NAME" "$CAPTION" send_file "${CHAT[ID]}" "$NAME" "$CAPTION"
rm "$NAME" rm "$NAME"
} }
[ ! -z ${LOCATION[*]} ] && send_location "${USER[ID]}" "${LOCATION[LATITUDE]}" "${LOCATION[LONGITUDE]}" [ ! -z ${LOCATION[*]} ] && send_location "${CHAT[ID]}" "${LOCATION[LATITUDE]}" "${LOCATION[LONGITUDE]}"
# Inline # Inline
if [ $INLINE == 1 ]; then if [ $INLINE == 1 ]; then
@ -43,7 +43,7 @@ else
answer_inline_query "$iQUERY_ID" "cached_gif" "BQADBAADIwYAAmwsDAABlIia56QGP0YC" answer_inline_query "$iQUERY_ID" "cached_gif" "BQADBAADIwYAAmwsDAABlIia56QGP0YC"
fi fi
if [[ $iQUERY_MSG == web ]]; then if [[ $iQUERY_MSG == web ]]; then
answer_inline_query "$iQUERY_ID" "article" "Telegram" "https://telegram.org/" answer_inline_query "$iQUERY_ID" "article" "GitHub" "http://github.com/topkecleon/telegram-bot-bash"
fi fi
fi fi
fi fi
@ -52,21 +52,32 @@ else
startproc "./question" startproc "./question"
;; ;;
'/info') '/info')
send_message "${USER[ID]}" "This is bashbot, the Telegram bot written entirely in bash." send_markdown_message "${CHAT[ID]}" "This is bashbot, the *Telegram* bot written entirely in *bash*."
;; ;;
'/start') '/start')
send_message "${USER[ID]}" "This is bashbot, the Telegram bot written entirely in bash. send_action "${CHAT[ID]}" "typing"
send__markdown_message "${CHAT[ID]}" "This is bashbot, the Telegram bot written entirely in bash.
It features background tasks and interactive chats, and can serve as an interface for CLI programs. It features background tasks and interactive chats, and can serve as an interface for CLI programs.
It currently can send, recieve and forward messages, custom keyboards, photos, audio, voice, documents, locations and video files. It currently can send, recieve and forward messages, custom keyboards, photos, audio, voice, documents, locations and video files.
Available commands: *Available commands*:
• /start: Start bot and get this message. *• /start*: _Start bot and get this message_.
• /info: Get shorter info message about this bot. *• /info*: _Get shorter info message about this bot_.
• /question: Start interactive chat. *• /question*: _Start interactive chat_.
• /cancel: Cancel any currently running interactive chats. *• /cancel*: _Cancel any currently running interactive chats_.
Written by Drew (@topkecleon) and Daniil Gentili (@danogentili). Written by Drew (@topkecleon) and Daniil Gentili (@danogentili).
http://github.com/topkecleon/telegram-bot-bash Get the code in my [GitHub](http://github.com/topkecleon/telegram-bot-bash)
" "
;; ;;
'/leavechat')
send_markdown_message "${CHAT[ID]}" "*CHAT LEAVED*"
leave_chat "${CHAT[ID]}"
;;
'/kickme')
kick_chat_member "${CHAT[ID]}" "${USER[ID]}"
unban_chat_member "${CHAT[ID]}" "${USER[ID]}"
'/cancel') '/cancel')
if tmux ls | grep -q $copname; then killproc && send_message "${USER[ID]}" "Command canceled.";else send_message "${USER[ID]}" "No command is currently running.";fi if tmux ls | grep -q $copname; then killproc && send_message "${USER[ID]}" "Command canceled.";else send_message "${USER[ID]}" "No command is currently running.";fi
;; ;;