init: fix msgs

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2021-01-27 13:35:31 +01:00
parent b45efa3726
commit ca9ea1bf31
2 changed files with 8 additions and 5 deletions

View File

@ -30,7 +30,7 @@ BOTCOMMANDS="-h help init start stop status suspendback resumeback killb
# 8 - curl/wget missing # 8 - curl/wget missing
# 10 - not bash! # 10 - not bash!
# #
#### $$VERSION$$ v1.35-dev-25-g079eb1c #### $$VERSION$$ v1.35-dev-26-gb45efa3
################################################################## ##################################################################
# emmbeded system may claim bash but it is not # emmbeded system may claim bash but it is not
@ -1144,19 +1144,20 @@ bot_init() {
read -r ANSWER read -r ANSWER
[[ "${ANSWER}" =~ ^[nN] ]] || cp -f "${BASHBOT_ETC:-.}/mycommands.conf.dist" "${BASHBOT_ETC:-.}/mycommands.conf" [[ "${ANSWER}" =~ ^[nN] ]] || cp -f "${BASHBOT_ETC:-.}/mycommands.conf.dist" "${BASHBOT_ETC:-.}/mycommands.conf"
fi fi
# adjust INLINE and CALLBACK # adjust INLINE CALLBACK MEONLY SILENCER
if [ -w "${BASHBOT_ETC:-.}/mycommands.conf" ]; then if [ -w "${BASHBOT_ETC:-.}/mycommands.conf" ]; then
printf "Activate processing for ${GREY}<I>nline qeurys, <C>allback buttons, <B>oth or <N>one${NC} in mycommands.sh? (i/c/b/N) N\b" printf "Activate processing for ${GREY}<I>nline queries, <C>allback buttons, <B>oth or <N>one${NC} in mycommands.sh? (i/c/b/N) N\b"
read -r ANSWER read -r ANSWER
[[ "${ANSWER}" =~ ^[iIbB] ]] && sed -i '/INLINE="/ s/^.*$/export INLINE="1"/' "${BASHBOT_ETC:-.}/mycommands.conf" [[ "${ANSWER}" =~ ^[iIbB] ]] && sed -i '/INLINE="/ s/^.*$/export INLINE="1"/' "${BASHBOT_ETC:-.}/mycommands.conf"
[[ "${ANSWER}" =~ ^[cCbB] ]] && sed -i '/CALLBACK="/ s/^.*$/export CALLBACK="1"/' "${BASHBOT_ETC:-.}/mycommands.conf" [[ "${ANSWER}" =~ ^[cCbB] ]] && sed -i '/CALLBACK="/ s/^.*$/export CALLBACK="1"/' "${BASHBOT_ETC:-.}/mycommands.conf"
printf "Always ignore commands for other Bots in chats ${GREY}(/cmd@other_bot)${NC}? (y/N) N\b" printf "Always ignore commands for other Bots in chat ${GREY}(/cmd@other_bot)${NC}? (y/N) N\b"
read -r ANSWER read -r ANSWER
[[ "${ANSWER}" =~ ^[yY] ]] && sed -i '/MEONLY="/ s/^.*$/export MEONLY="1"/' "${BASHBOT_ETC:-.}/mycommands.conf" [[ "${ANSWER}" =~ ^[yY] ]] && sed -i '/MEONLY="/ s/^.*$/export MEONLY="1"/' "${BASHBOT_ETC:-.}/mycommands.conf"
printf "Delete administrative messages in chats ${GREY}(pinned, user join/leave, ...)${NC}? (y/N) N\b" printf "Delete administrative messages in chats ${GREY}(pinned, user join/leave, ...)${NC}? (y/N) N\b"
read -r ANSWER read -r ANSWER
[[ "${ANSWER}" =~ ^[yY] ]] && sed -i '/SILENCER="/ s/^.*$/export SILENCER="yes"/' "${BASHBOT_ETC:-.}/mycommands.conf" [[ "${ANSWER}" =~ ^[yY] ]] && sed -i '/SILENCER="/ s/^.*$/export SILENCER="yes"/' "${BASHBOT_ETC:-.}/mycommands.conf"
fi fi
printf "Done.\n"
fi fi
# adjust permissions # adjust permissions
printf "Adjusting files and permissions for user \"${touser}\" ...\n" printf "Adjusting files and permissions for user \"${touser}\" ...\n"

View File

@ -10,7 +10,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.35-dev-24-g5a0a571 #### $$VERSION$$ v1.35-dev-26-gb45efa3
####################################################### #######################################################
# shellcheck disable=SC1117 # shellcheck disable=SC1117
@ -55,6 +55,8 @@ else
[ -n "${REMOVEKEYBOARD}" ] && remove_keyboard "${CHAT[ID]}" & [ -n "${REMOVEKEYBOARD}" ] && remove_keyboard "${CHAT[ID]}" &
[[ -n "${REMOVEKEYBOARD_PRIVATE}" && "${CHAT[ID]}" == "${USER[ID]}" ]] && remove_keyboard "${CHAT[ID]}" & [[ -n "${REMOVEKEYBOARD_PRIVATE}" && "${CHAT[ID]}" == "${USER[ID]}" ]] && remove_keyboard "${CHAT[ID]}" &
# uncommet to fix first letter upper case because of smartphone auto correction
#[[ "${MESSAGE}" =~ ^/[[:upper:]] ]] && MESSAGE="${MESSAGE:0:1}$(tr '[:upper:]' '[:lower:]' <<<"${MESSAGE:1:1}")${MESSAGE:2}"
case "${MESSAGE}" in case "${MESSAGE}" in
################## ##################
# example command, replace them by your own # example command, replace them by your own