mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-16 13:05:09 +00:00
Misc. grammar / formatting changes
This commit is contained in:
parent
f1672bd536
commit
c90356bfe1
@ -31,7 +31,7 @@ unset IFS
|
||||
|
||||
# kill interactive script if not finished in time, e.g. user away or error
|
||||
MAXWAIT="1m"
|
||||
{ sleep "${MAXWAIT}"; printf "Stopping Questionnaire after %s, you need to much time to finish ... BYE\n" "${MAXWAIT}"; kill $$; wait 2>/dev/null ;} &
|
||||
{ sleep "${MAXWAIT}"; printf "Stopping questionnaire after %s. You've taken too much time to finish! BYE\n" "${MAXWAIT}"; kill $$; wait 2>/dev/null ;} &
|
||||
|
||||
# simple yes/no question, defaults to no
|
||||
printf "Hi, hello there\nWould you like some tea (y/n)?\n"
|
||||
@ -44,10 +44,10 @@ fi
|
||||
|
||||
# question with Keyboard, repeating until correct answer given
|
||||
until [ "${SUCCESS}" = "y" ] ;do
|
||||
printf 'Do you like Music? mykeyboardstartshere "Yass!" , "No"\n'
|
||||
printf 'Do you like music? mykeyboardstartshere "Yass!" , "No"\n'
|
||||
read -r answer <"${INPUT}"
|
||||
case ${answer,,} in
|
||||
'') printf "empty answer! Try again\n";;
|
||||
'') printf "Empty answer! Try again\n";;
|
||||
'yass'*) printf "Goody! mykeyboardendshere\n";SUCCESS=y;;
|
||||
'no'*) printf "Well that's weird. mykeyboardendshere\n";SUCCESS=y;;
|
||||
*) SUCCESS=n;;
|
||||
|
@ -123,22 +123,22 @@ else
|
||||
|
||||
case "${MESSAGE}" in
|
||||
##################
|
||||
# example commands, replace them by your own
|
||||
# example commands, replace them with your own
|
||||
'/_dice_re'*) # dice from user received
|
||||
sleep 5
|
||||
local gameresult="*Congratulation ${USER[FIRST_NAME]} ${USER[LAST_NAME]}* you got *${MESSAGE[RESULT]} Points*."
|
||||
local gameresult="*Congratulations, ${USER[FIRST_NAME]} ${USER[LAST_NAME]}*, you got *${MESSAGE[RESULT]} points*."
|
||||
[ -z "${FORWARD[UID]}" ] && send_markdownv2_message "${CHAT[ID]}" "${gameresult}"
|
||||
;;
|
||||
'/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):"
|
||||
if [ "${BOTSENT[OK]}" = "true" ]; then
|
||||
local gameresult="*Congratulation ${USER[FIRST_NAME]}* ${USER[LAST_NAME]} you got *${BOTSENT[RESULT]} Points*."
|
||||
local gameresult="*Congratulations, ${USER[FIRST_NAME]} ${USER[LAST_NAME]}*, you got *${BOTSENT[RESULT]} points*."
|
||||
sleep 5
|
||||
case "${BOTSENT[RESULT]}" in
|
||||
1) gameresult="*Sorry* only *one Point* ...";;
|
||||
2) gameresult="*Hey*, 2 Points are *more then one!*";;
|
||||
5|6) [[ "${BOTSENT[EMOJI]}" =~ fb0$ ]] || gameresult="*Super! ${BOTSENT[RESULT]} Points!*";;
|
||||
6*) gameresult="*JACKPOT! ${BOTSENT[RESULT]} Points!*";;
|
||||
1) gameresult="*Sorry* only *one point* ...";;
|
||||
2) gameresult="*Hey*, 2 points are *better than one!*";;
|
||||
5|6) [[ "${BOTSENT[EMOJI]}" =~ fb0$ ]] || gameresult="*Super! You got ${BOTSENT[RESULT]} points!*";;
|
||||
6*) gameresult="*JACKPOT! ${BOTSENT[RESULT]} points!*";;
|
||||
esac
|
||||
send_markdownv2_message "${CHAT[ID]}" "${gameresult}"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user