From 859377c970edbe35bf617b5616a6dbf2eea0d722 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 20 Feb 2026 12:24:58 +0300 Subject: [PATCH] Fix bot_started chat_id Co-authored-by: Cursor --- n8n-code-node-max-normalize.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/n8n-code-node-max-normalize.js b/n8n-code-node-max-normalize.js index 7605642..33252c0 100644 --- a/n8n-code-node-max-normalize.js +++ b/n8n-code-node-max-normalize.js @@ -59,7 +59,14 @@ const callbackUser = raw?.callback?.user; const userId = callbackUser?.user_id ?? callbackUser?.id ?? sender?.user_id ?? sender?.id ?? raw?.user_id ?? msg?.sender?.user_id; result.max_id = userId; -const chatId = msg?.recipient?.chat_id ?? msg?.recipient?.user_id ?? recipient?.chat_id ?? recipient?.user_id ?? userId; +const chatId = + msg?.recipient?.chat_id ?? + msg?.recipient?.user_id ?? + msg?.chat_id ?? + recipient?.chat_id ?? + recipient?.user_id ?? + raw?.chat_id ?? + userId; result.max_chat_id = chatId; // ----- 2) Ответ на сообщение / пересланное (message.link = LinkedMessage) -----