From 4cfa95bb9215f4f7f66eee1ea7896727272065b0 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Feb 2026 14:55:33 +0000 Subject: [PATCH] fix(buttons): remove bot node for ALL native_flow buttons (Web/Desktop compat) The node prevents WhatsApp Web/Desktop from rendering ALL native_flow button types, not just CTA. Quick_reply buttons had the same issue: visible on smartphone only. Confirmed: removing bot node fixes rendering on Web/Desktop for both CTA buttons and quick_reply buttons. https://claude.ai/code/session_01EK9NpViRCtda1WAvFd8ptR --- src/Socket/messages-send.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Socket/messages-send.ts b/src/Socket/messages-send.ts index 4dc539d8..a77161f4 100644 --- a/src/Socket/messages-send.ts +++ b/src/Socket/messages-send.ts @@ -1335,18 +1335,20 @@ export const makeMessagesSocket = (config: SocketConfig) => { }) } - // For private 1:1 chats, conditionally add bot node - // - quick_reply buttons need bot node for response handling - // - CTA-only buttons (cta_url, cta_copy, cta_call) should NOT have bot node - // as they are business actions and the bot node prevents WhatsApp Web rendering - // - Carousels and catalog messages should NOT have bot node + // Bot node () MUST NOT be injected for native_flow buttons + // It prevents WhatsApp Web/Desktop from rendering ALL button types + // (both quick_reply and CTA buttons). Confirmed by testing: + // - CTA buttons without bot node: works on Web ✅ + // - quick_reply buttons with bot node: only smartphone, not Web ❌ + const isNativeFlowButtons = buttonType === 'native_flow' + const isPrivateUserChat = ( isPnUser(destinationJid) || isLidUser(destinationJid) || destinationJid?.endsWith('@c.us') ) && !isJidBot(destinationJid) - if (isPrivateUserChat && !isCarousel && !isCatalog && buttonType !== 'list' && !isCTAOnly) { + if (isPrivateUserChat && !isCarousel && !isCatalog && buttonType !== 'list' && !isNativeFlowButtons) { ;(stanza.content as BinaryNode[]).push({ tag: 'bot', attrs: { biz_bot: '1' } @@ -1355,10 +1357,10 @@ export const makeMessagesSocket = (config: SocketConfig) => { { msgId, to: destinationJid }, '[EXPERIMENTAL] Added bot node for private chat interactive message' ) - } else if (isCTAOnly) { + } else if (isNativeFlowButtons) { logger.debug( { msgId, to: destinationJid, buttonNames: allButtonNames }, - '[EXPERIMENTAL] Skipping bot node for CTA-only buttons (Web compatibility)' + '[EXPERIMENTAL] Skipping bot node for native_flow buttons (Web/Desktop compatibility)' ) } else if (isCarousel) { logger.debug(