Skip to content

Commit

Permalink
fix: Added trick to send list message (WPP.chat.sendListMessage)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Oct 29, 2023
1 parent f5b4cb9 commit 752329b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/chat/functions/prepareMessageButtons.ts
Expand Up @@ -339,7 +339,9 @@ webpack.onFullReady(() => {
if (proto.buttonsMessage) {
buttonNode = websocket.smax('buttons');
} else if (proto.listMessage) {
const listType: number = proto.listMessage.listType || 0;
// The trick to send list message is to force the 'product_list' type in the biz node
// const listType: number = proto.listMessage.listType || 0;
const listType = 2;

const types = ['unknown', 'single_select', 'product_list'];

Expand Down
2 changes: 1 addition & 1 deletion src/chat/functions/sendListMessage.ts
Expand Up @@ -94,7 +94,7 @@ export async function sendListMessage(
description: options.description || ' ',
title: options.title,
footerText: options.footer,
listType: 2,
listType: 1,
sections,
};

Expand Down

0 comments on commit 752329b

Please sign in to comment.