add exmaple welcome message to mycommands

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2020-06-29 20:17:23 +02:00
parent 10f0dea98d
commit 9e89627ae9
2 changed files with 15 additions and 3 deletions

View File

@ -74,7 +74,7 @@ Start or Stop your Bot use the following commands:
./bashbot.sh start ./bashbot.sh start
``` ```
```bash ```bash
./bashbot.sh kill ./bashbot.sh stop
``` ```
### User stats ### User stats
@ -283,5 +283,5 @@ send_action "${CHAT[ID]}" "action"
#### [Prev Create Bot](1_firstbot.md) #### [Prev Create Bot](1_firstbot.md)
#### [Next Advanced Usage](3_advanced.md) #### [Next Advanced Usage](3_advanced.md)
#### $$VERSION$$ v0.962-114-g595d21f #### $$VERSION$$ v0.962-115-g10f0dea

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.962-114-g595d21f #### $$VERSION$$ v0.962-115-g10f0dea
# #
# uncomment the following lines to overwrite info and help messages # uncomment the following lines to overwrite info and help messages
@ -52,6 +52,10 @@ export SILENCER="no"
# export REMOVEKEYBOARD="yes" # export REMOVEKEYBOARD="yes"
# export REMOVEKEYBOARD_PRIVATE="yes" # export REMOVEKEYBOARD_PRIVATE="yes"
# uncomment if you want to say welcome to new chat members
# export WELCOME_NEWMEMBER="yes"
WELCOME_MSG="Welcome"
# 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"
@ -126,6 +130,14 @@ else
# but if we do, remove /edited_message # but if we do, remove /edited_message
MESSAGE="${MESSAGE#/* }" MESSAGE="${MESSAGE#/* }"
;; ;;
'/_new_chat_member'*)
if [[ -n "${WELCOME_NEWMEMBER}" && "${NEWMEMBER[ISBOT]}" != "true" ]]; then
send_normal_message "${CHAT[ID]}"\
"${WELCOME_MSG} ${NEWMEMBER[FIRST_NAME]} ${NEWMEMBER[LAST_NAME]} (@${NEWMEMBER[USERNAME]})"
MYSENTID="${BOTSENT[ID]}"
{ sleep 5; delete_message "${CHAT[ID]}" "${MYSENTID}"; } &
fi
;;
esac esac
case "${MESSAGE}" in case "${MESSAGE}" in