|
|
|
@ -44,6 +44,30 @@ export const sentMsgTypeMapped = {
|
|
|
|
|
: {}),
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
photo: {
|
|
|
|
|
type: 'image',
|
|
|
|
|
contentToSend: (msg) => ({
|
|
|
|
|
action: 'message',
|
|
|
|
|
actionId: msg.id,
|
|
|
|
|
renderId: msg.id,
|
|
|
|
|
to: msg.to,
|
|
|
|
|
msgtype: 'image',
|
|
|
|
|
msgcontent: {
|
|
|
|
|
image: { link: msg.data.uri },
|
|
|
|
|
...(msg.context ? { context: msg.context, message_origin: msg.message_origin } : {}),
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
contentToRender: (msg) => ({
|
|
|
|
|
...msg,
|
|
|
|
|
actionId: msg.id,
|
|
|
|
|
conversationid: msg.id.split('.')[0],
|
|
|
|
|
...(msg.context
|
|
|
|
|
? {
|
|
|
|
|
reply: { message: msg.message_origin.text, title: msg.message_origin.senderName || 'Reference' },
|
|
|
|
|
}
|
|
|
|
|
: {}),
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
whatsappTemplate: {
|
|
|
|
|
contentToSend: (msg) => ({ action: 'message', actionId: msg.id, renderId: msg.id, to: msg.to, msgtype: 'template', msgcontent: msg.template }),
|
|
|
|
|
contentToRender: (msg) => {
|
|
|
|
|