fix: use correct nested biz node structure for interactive messages

Changes the biz node from flat structure (biz > native_flow) to nested
structure (biz > interactive > native_flow) as used by Pastorini/Astra-Api.

Structure:
- biz: {}
  - interactive: { type: 'native_flow', v: '1' }
    - native_flow: { v: '9', name: 'mixed' }

This fixes error 479 that was breaking all interactive messages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Renato Alcara
2026-01-27 09:26:54 -03:00
parent 345c1b649a
commit 832a5c6e11
+16 -2
View File
@@ -1137,13 +1137,27 @@ export const makeMessagesSocket = (config: SocketConfig) => {
metrics.interactiveMessagesSent.inc({ type: buttonType })
try {
// Use nested structure: biz > interactive > native_flow
// This matches the working Pastorini/Astra-Api implementation
;(stanza.content as BinaryNode[]).push({
tag: 'biz',
attrs: {},
content: [
{
tag: buttonType,
attrs: getButtonArgs(message)
tag: 'interactive',
attrs: {
type: 'native_flow',
v: '1'
},
content: [
{
tag: 'native_flow',
attrs: {
v: '9',
name: 'mixed'
}
}
]
}
]
})