From 94006fe1049299dbc5b750649c01c14a1117ec41 Mon Sep 17 00:00:00 2001 From: anten-ka Date: Sun, 22 Mar 2026 14:07:36 +0300 Subject: [PATCH] Fix bot_auto_chatid: disable+stop daemon to prevent Restart=always from stealing updates Made-with: Cursor --- warp.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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