mycommands: update send_dice example

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2021-02-08 17:17:44 +01:00
parent b2fc4052fc
commit 897458a37f

View File

@ -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-9-g62b6b61 #### $$VERSION$$ v1.45-dev-10-gb2fc405
####################################################### #######################################################
# shellcheck disable=SC1117 # shellcheck disable=SC1117
@ -124,15 +124,16 @@ else
case "${MESSAGE}" in case "${MESSAGE}" in
################## ##################
# example commands, replace them by your own # example commands, replace them by your own
'/game'*) # send random dice 1-5 '/game'*) # send random dice, edit list to fit your needs
send_dice "${CHAT[ID]}" "$(shuf -i "1-5" -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* 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* ...";;
2) gameresult="*Hey*, 2 Points are *more then one!*";; 2) gameresult="*Hey*, 2 Points are *more then one!*";;
64) gameresult="*JACKPOT! ${BOTSENT[RESULT]} Points!*" 5|6) [[ "${BOTSENT[EMOJI]}" =~ fb0$ ]] || gameresult="*Super! ${BOTSENT[RESULT]} Points!*";;
6*) gameresult="*JACKPOT! ${BOTSENT[RESULT]} Points!*";;
esac esac
send_markdownv2_message "${CHAT[ID]}" "${gameresult}" send_markdownv2_message "${CHAT[ID]}" "${gameresult}"
fi fi