From e654ec51ed43de46ee576f603ddfcf89dfa870ad Mon Sep 17 00:00:00 2001 From: jarriztg Date: Sun, 5 Jun 2016 05:42:20 -0500 Subject: [PATCH] Update commands.sh (#20) * Update commands.sh * Update commands.sh * Update commands.sh * Update commands.sh * Update commands.sh --- commands.sh | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/commands.sh b/commands.sh index 380e4e4..17363ea 100755 --- a/commands.sh +++ b/commands.sh @@ -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 ;;