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) -----