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
1 changed files with 22 additions and 11 deletions

View File

@ -16,10 +16,10 @@ else
if ! tmux ls | grep -v send | grep -q $copname; then
[ ! -z ${URLS[*]} ] && {
curl -s ${URLS[*]} -o $NAME
send_file "${USER[ID]}" "$NAME" "$CAPTION"
send_file "${CHAT[ID]}" "$NAME" "$CAPTION"
rm "$NAME"
}
[ ! -z ${LOCATION[*]} ] && send_location "${USER[ID]}" "${LOCATION[LATITUDE]}" "${LOCATION[LONGITUDE]}"
[ ! -z ${LOCATION[*]} ] && send_location "${CHAT[ID]}" "${LOCATION[LATITUDE]}" "${LOCATION[LONGITUDE]}"
# Inline
if [ $INLINE == 1 ]; then
@ -43,7 +43,7 @@ else
answer_inline_query "$iQUERY_ID" "cached_gif" "BQADBAADIwYAAmwsDAABlIia56QGP0YC"
fi
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
@ -52,21 +52,32 @@ else
startproc "./question"
;;
'/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')
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 currently can send, recieve and forward messages, custom keyboards, photos, audio, voice, documents, locations and video files.
Available commands:
• /start: Start bot and get this message.
• /info: Get shorter info message about this bot.
• /question: Start interactive chat.
• /cancel: Cancel any currently running interactive chats.
*Available commands*:
*• /start*: _Start bot and get this message_.
*• /info*: _Get shorter info message about this bot_.
*• /question*: _Start interactive chat_.
*• /cancel*: _Cancel any currently running interactive chats_.
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')
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
;;