diff --git a/mycommands.sh b/mycommands.sh index 3e3a97b..f2e301b 100644 --- a/mycommands.sh +++ b/mycommands.sh @@ -8,7 +8,7 @@ # #### if you start to develop your own bot, use the clean version of this file: # #### mycommands.clean # -#### $$VERSION$$ v0.98-pre2-0-ga597303 +#### $$VERSION$$ v0.98-pre2-7-g3569a76 # # 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 export SILENCER="no" +# uncomment if you use keyboards in your commands +# export REMOVEKEYBOARD="yes" +# export REMOVEKEYBOARD_PRIVATE="yes" + # messages for admin only commands NOTADMIN="Sorry, this command is allowed for admin or owner only" NOTBOTADMIN="Sorry, this command is allowed for bot owner only" @@ -82,6 +86,10 @@ else 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 case "${USER[ID]}+${CHAT[ID]}" in 'USERID+'*) # do something for all messages from USER @@ -218,7 +226,6 @@ else answer_inline_query "${iQUERY[ID]}" "cached_gif" "BQADBAADIwYAAmwsDAABlIia56QGP0YC" ;; esac -set +x } # place your processing functions here diff --git a/mycommands.sh.clean b/mycommands.sh.clean index 9074668..3705e6d 100644 --- a/mycommands.sh.clean +++ b/mycommands.sh.clean @@ -4,7 +4,7 @@ # files: mycommands.sh.clean # 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 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 # @@ -78,6 +82,10 @@ else 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 ################## # example command, replace them by your own