This commit is contained in:
juewuy
2026-01-17 20:09:21 +08:00

View File

@@ -192,46 +192,49 @@ set_bot_tg_service(){
fi fi
setconfig bot_tg_service "$bot_tg_service" setconfig bot_tg_service "$bot_tg_service"
} }
set_bot_tg(){
[ -n "$ts_auth_key" ] && ts_auth_key_info='已设置' set_bot_tg() {
[ -n "$TG_CHATID" ] && TG_CHATID_info='已绑定' while true; do
echo "-----------------------------------------------" [ -n "$ts_auth_key" ] && ts_auth_key_info='已设置'
echo -e "\033[31m注意\033[0m由于网络环境原因此机器人仅限服务启动时运行" [ -n "$TG_CHATID" ] && TG_CHATID_info='已绑定'
echo "-----------------------------------------------" echo "-----------------------------------------------"
echo -e " 1 启用/关闭TG-BOT服务 \033[32m$bot_tg_service\033[0m" echo -e "\033[31m注意\033[0m由于网络环境原因此机器人仅限服务启动时运行"
echo -e " 2 TG-BOT绑定设置 \033[32m$TG_CHATID_info\033[0m" echo "-----------------------------------------------"
echo -e " 0 返回上级菜单 \033[0m" echo -e " 1 启用/关闭TG-BOT服务 \033[32m$bot_tg_service\033[0m"
echo "-----------------------------------------------" echo -e " 2 TG-BOT绑定设置 \033[32m$TG_CHATID_info\033[0m"
read -p "请输入对应数字 > " num echo -e " 0 返回上级菜单 \033[0m"
case "$num" in echo "-----------------------------------------------"
0) ;; read -pr "请输入对应数字 > " num
1) case "$num" in
. "$GT_CFG_PATH" "" | 0)
if [ -n "$TG_CHATID" ];then break
set_bot_tg_service ;;
else 1)
echo -e "\033[31m请先绑定TG-BOT\033[0m" . "$GT_CFG_PATH"
fi if [ -n "$TG_CHATID" ]; then
sleep 1 set_bot_tg_service
set_bot_tg else
;; echo -e "\033[31m请先绑定TG-BOT\033[0m"
2) fi
if [ -n "$chat_ID" ] && [ -n "$push_TG" ] && [ "$push_TG" != 'publictoken' ]; then sleep 1
read -p "检测到已经绑定了TG推送BOT是否直接使用(1/0) > " res ;;
if [ "$res" = 1 ]; then 2)
TOKEN="$push_TG" if [ -n "$chat_ID" ] && [ -n "$push_TG" ] && [ "$push_TG" != 'publictoken' ]; then
set_bot_tg_config read -pr "检测到已经绑定了TG推送BOT是否直接使用(1/0) > " res
set_bot_tg if [ "$res" = 1 ]; then
return TOKEN="$push_TG"
fi set_bot_tg_config
fi continue
set_bot_tg_init fi
set_bot_tg fi
;; set_bot_tg_init
*) ;;
errornum *)
;; errornum
esac sleep 1
;;
esac
done
} }
# 自定义入站 # 自定义入站