mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-25 16:57:33 +00:00
Update commands.sh (#20)
* Update commands.sh * Update commands.sh * Update commands.sh * Update commands.sh * Update commands.sh
This commit is contained in:
parent
d169b7f96f
commit
e654ec51ed
33
commands.sh
33
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
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user