diff --git a/src/lib/msgUtils.js b/src/lib/msgUtils.js index 5319bb2..d25e594 100644 --- a/src/lib/msgUtils.js +++ b/src/lib/msgUtils.js @@ -151,7 +151,7 @@ export const sentMsgTypeMapped = { }), }, whatsappTemplate: { - contentToSend: (msg) => ({ action: 'message', actionId: msg.id, renderId: msg.id, to: msg.to, msgtype: 'template', msgcontent: msg.template }), + contentToSend: (msg) => ({ action: 'message', actionId: msg.id, renderId: msg.id, to: msg.to, msgtype: 'template', msgcontent: { ...msg.template, components: msg.template.components.filter(com => com.type.toLowerCase() === 'body') }}), // todo: 其他组件不发送是否可以 contentToRender: (msg) => { const templateDataMapped = msg.template?.components ? msg.template.components.reduce((r, v) => ({ ...r, [v.type]: v }), {}) : null; // const templateParam = (templateDataMapped?.body?.parameters || []).map(e => e.text);