diff --git a/warp.sh b/warp.sh index a2e8c47..ab1a3ca 100644 --- a/warp.sh +++ b/warp.sh @@ -1723,8 +1723,9 @@ bot_remove_admin() { } bot_auto_chatid() { + systemctl disable warp-bot 2>/dev/null systemctl stop warp-bot 2>/dev/null - sleep 1 + sleep 3 local flush_resp last_uid flush_resp=$(curl -s "https://api.telegram.org/bot${BOT_TOKEN}/getUpdates?offset=-1&limit=1") last_uid=$(echo "$flush_resp" | jq -r '.result[-1].update_id // empty' 2>/dev/null) @@ -1734,6 +1735,7 @@ bot_auto_chatid() { echo -e "${YELLOW} Отправьте боту 3 любых сообщения в Telegram.${NC}" echo -e "${YELLOW} Затем нажмите Enter.${NC}" read -p " > " _ + sleep 1 local resp; resp=$(curl -s --max-time 10 "https://api.telegram.org/bot${BOT_TOKEN}/getUpdates?limit=10") local c; c=$(echo "$resp" | jq -r '[.result[].message.chat.id // empty] | map(select(. != "")) | unique | first // empty' 2>/dev/null) if [ -n "$c" ] && [[ "$c" =~ ^[0-9-]+$ ]]; then