|
|
|
@ -334,7 +334,7 @@ export const whatsappMsgTypeMapped = {
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
// unsupported: { type: 'system', data: (msg) => ({ text: 'Message type is currently not supported.' }) },
|
|
|
|
|
unsupported: { type: 'text', data: (msg) => ({ text: '[暂不支持此消息类型]' }) },
|
|
|
|
|
unsupported: { type: 'text', data: (msg) => ({ text: `[暂不支持此消息类型](${msg.id})` }) },
|
|
|
|
|
reaction: {
|
|
|
|
|
type: 'text',
|
|
|
|
|
data: (msg) => ({ id: msg.wamid, text: msg.reaction?.emoji || '' }),
|
|
|
|
@ -353,6 +353,16 @@ export const whatsappMsgTypeMapped = {
|
|
|
|
|
message: msg.document?.caption || msg.document?.filename || '',
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
contacts: {
|
|
|
|
|
type: 'meetingLink',
|
|
|
|
|
data: (msg) => ({
|
|
|
|
|
id: msg.wamid,
|
|
|
|
|
meetingID: msg.wamid,
|
|
|
|
|
title: msg.contacts.length === 1 ? `联系人` : `${msg.contacts.length} 位联系人`,
|
|
|
|
|
text: msg.contacts.map(ele => `${ele.name.formatted_name}: ${ele.phones[0].wa_id}`).join('\n'),
|
|
|
|
|
data: msg.contacts.map(ele => ({ id: ele.phones[0].wa_id, wa_id: ele.phones[0].wa_id, name: ele.name.formatted_name })),
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
// location: 'location',
|
|
|
|
|
// contact: 'contact',
|
|
|
|
|
// 'contact-card': 'contact-card',
|
|
|
|
|