mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-22 07:25:10 +00:00
mycommands: react on user sent dice
This commit is contained in:
parent
2f4ef69971
commit
e67e43dd2e
@ -13,7 +13,7 @@
|
|||||||
# License: WTFPLv2 http://www.wtfpl.net/txt/copying/
|
# License: WTFPLv2 http://www.wtfpl.net/txt/copying/
|
||||||
# Author: KayM (gnadelwartz), kay@rrr.de
|
# Author: KayM (gnadelwartz), kay@rrr.de
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v1.45-dev-13-g117255a
|
#### $$VERSION$$ v1.45-dev-20-g2f4ef69
|
||||||
#######################################################
|
#######################################################
|
||||||
# shellcheck disable=SC1117
|
# shellcheck disable=SC1117
|
||||||
|
|
||||||
@ -124,10 +124,15 @@ else
|
|||||||
case "${MESSAGE}" in
|
case "${MESSAGE}" in
|
||||||
##################
|
##################
|
||||||
# example commands, replace them by your own
|
# example commands, replace them by your own
|
||||||
|
'/_dice_re'*) # dice from user received
|
||||||
|
sleep 5
|
||||||
|
local gameresult="*Congratulation ${USER[FIRST_NAME]} ${USER[LAST_NAME]}* you got *${MESSAGE[RESULT]} Points*."
|
||||||
|
send_markdownv2_message "${CHAT[ID]}" "${gameresult}"
|
||||||
|
;;
|
||||||
'/game'*) # send random dice, edit list to fit your needs
|
'/game'*) # send random dice, edit list to fit your needs
|
||||||
send_dice "${CHAT[ID]}" ":$(printf "slot_machine\ngame_die\ndart\nbasketball\nsoccer\nslot_machine"|sort -R|shuf -n 1shuf -n 1):"
|
send_dice "${CHAT[ID]}" ":$(printf "slot_machine\ngame_die\ndart\nbasketball\nsoccer\nslot_machine"|sort -R|shuf -n 1shuf -n 1):"
|
||||||
if [ "${BOTSENT[OK]}" = "true" ]; then
|
if [ "${BOTSENT[OK]}" = "true" ]; then
|
||||||
local gameresult="*Congratulation* you got *${BOTSENT[RESULT]} Points*."
|
local gameresult="*Congratulation ${USER[FIRST_NAME]}* ${USER[LAST_NAME]} you got *${BOTSENT[RESULT]} Points*."
|
||||||
sleep 5
|
sleep 5
|
||||||
case "${BOTSENT[RESULT]}" in
|
case "${BOTSENT[RESULT]}" in
|
||||||
1) gameresult="*Sorry* only *one Point* ...";;
|
1) gameresult="*Sorry* only *one Point* ...";;
|
||||||
|
Loading…
Reference in New Issue
Block a user