optional remove_keyboard in mycommands

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2020-06-27 16:01:27 +02:00
parent 3569a761e1
commit a656533693
2 changed files with 18 additions and 3 deletions

View File

@ -8,7 +8,7 @@
# #### if you start to develop your own bot, use the clean version of this file: # #### if you start to develop your own bot, use the clean version of this file:
# #### mycommands.clean # #### mycommands.clean
# #
#### $$VERSION$$ v0.98-pre2-0-ga597303 #### $$VERSION$$ v0.98-pre2-7-g3569a76
# #
# uncomment the following lines to overwrite info and help messages # uncomment the following lines to overwrite info and help messages
@ -48,6 +48,10 @@ unset BASHBOT_START_TIMER
# set to "yes" and give your bot admin privilegs to remove service messaes from groups # set to "yes" and give your bot admin privilegs to remove service messaes from groups
export SILENCER="no" export SILENCER="no"
# uncomment if you use keyboards in your commands
# export REMOVEKEYBOARD="yes"
# export REMOVEKEYBOARD_PRIVATE="yes"
# messages for admin only commands # messages for admin only commands
NOTADMIN="Sorry, this command is allowed for admin or owner only" NOTADMIN="Sorry, this command is allowed for admin or owner only"
NOTBOTADMIN="Sorry, this command is allowed for bot owner only" NOTBOTADMIN="Sorry, this command is allowed for bot owner only"
@ -82,6 +86,10 @@ else
fi fi
fi fi
# remove keyboard if you use keyboards
[ -n "${REMOVEKEYBOARD}" ] && remove_keyboard "${CHAT[ID]}" &
[[ -n "${REMOVEKEYBOARD_PRIVATE}" && "${CHAT[ID]}" == "${USER[ID]}" ]] && remove_keyboard "${CHAT[ID]}" &
# example for actions based on chat or sender # example for actions based on chat or sender
case "${USER[ID]}+${CHAT[ID]}" in case "${USER[ID]}+${CHAT[ID]}" in
'USERID+'*) # do something for all messages from USER 'USERID+'*) # do something for all messages from USER
@ -218,7 +226,6 @@ else
answer_inline_query "${iQUERY[ID]}" "cached_gif" "BQADBAADIwYAAmwsDAABlIia56QGP0YC" answer_inline_query "${iQUERY[ID]}" "cached_gif" "BQADBAADIwYAAmwsDAABlIia56QGP0YC"
;; ;;
esac esac
set +x
} }
# place your processing functions here # place your processing functions here

View File

@ -4,7 +4,7 @@
# files: mycommands.sh.clean # files: mycommands.sh.clean
# copy to mycommands.sh and add all your commands and functions here ... # copy to mycommands.sh and add all your commands and functions here ...
# #
#### $$VERSION$$ v0.98-pre2-0-ga597303 #### $$VERSION$$ v0.98-pre2-7-g3569a76
# #
########## ##########
@ -45,6 +45,10 @@ unset BASHBOT_START_TIMER
# set to "yes" and give your bot admin privilegs to remove service messaes from groups # set to "yes" and give your bot admin privilegs to remove service messaes from groups
export SILENCER="no" export SILENCER="no"
# uncomment if you use keyboards in your commands
# export REMOVEKEYBOARD="yes"
# export REMOVEKEYBOARD_PRIVATE="yes"
######## ########
# special network setups may require to provide additional ARGS to curl # special network setups may require to provide additional ARGS to curl
# #
@ -78,6 +82,10 @@ else
fi fi
fi fi
# remove keyboard if you use keyboards
[ -n "${REMOVEKEYBOARD}" ] && remove_keyboard "${CHAT[ID]}" &
[[ -n "${REMOVEKEYBOARD_PRIVATE}" && "${CHAT[ID]}" == "${USER[ID]}" ]] && remove_keyboard "${CHAT[ID]}" &
case "${MESSAGE}" in case "${MESSAGE}" in
################## ##################
# example command, replace them by your own # example command, replace them by your own