From 5d5a973ffd3c4d94fb6826dbf8c095cd3988e4c1 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Feb 2026 18:16:59 +0000 Subject: [PATCH] fix(carousel): enviar interactiveMessage direto + biz node + sem viewOnceMessage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ajuste na estrutura do carrossel para renderizar na Web: 1. Removido viewOnceMessage wrapper - carrossel usa interactiveMessage direto 2. Biz node habilitado com native_flow v=9 name=mixed 3. Removido subtitle vazio e header vazio do nível raiz 4. Sem bot node (já estava correto) https://claude.ai/code/session_01EK9NpViRCtda1WAvFd8ptR --- src/Utils/messages.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/Utils/messages.ts b/src/Utils/messages.ts index 81b9791f..ede4c8a0 100644 --- a/src/Utils/messages.ts +++ b/src/Utils/messages.ts @@ -616,7 +616,6 @@ export const generateCarouselMessage = async ( const header: any = { title: card.title || '', - subtitle: '', hasMediaAttachment: hasMedia } @@ -641,7 +640,7 @@ export const generateCarouselMessage = async ( } })) - // Build the interactive message with carousel (matching Pastorini structure) + // Build the interactive message with carousel (matching Pastorini structure exactly) const interactiveMessage: proto.Message.IInteractiveMessage = { body: { text: text || '' }, footer: footer ? { text: footer } : undefined, @@ -651,15 +650,11 @@ export const generateCarouselMessage = async ( } } - // Wrap in viewOnceMessage for WhatsApp Web/Desktop compatibility - // Without this wrapper, Web only renders header/body text - // Note: using minimal wrapper (no messageContextInfo) to avoid error 479 + // Return as direct interactiveMessage (matching Pastorini exactly) + // Pastorini sends interactiveMessage without viewOnceMessage wrapper + // and it renders on Web. Biz node is injected separately in messages-send.ts return { - viewOnceMessage: { - message: { - interactiveMessage - } - } + interactiveMessage } } @@ -1156,8 +1151,8 @@ export const generateWAMessageContent = async ( } // Pass options for media processing if cards have images/videos const generated = await generateCarouselMessage(carouselOptions, options) - m.viewOnceMessage = generated.viewOnceMessage - options.logger?.info('Sending carouselMessage with viewOnceMessage wrapper (no messageContextInfo)') + m.interactiveMessage = generated.interactiveMessage + options.logger?.info('Sending carouselMessage as direct interactiveMessage (matching Pastorini)') } // Check for nativeList else if (hasNonNullishProperty(message, 'nativeList')) {