Codificação para que a resposta do atendente seja sempre pelo mesmo whatsapp do destinatário

pull/1/head
adriano 2022-04-23 14:22:51 -03:00
parent ab498d5be1
commit ce0b677c0c
2 changed files with 15 additions and 3 deletions

View File

@ -50,10 +50,10 @@ const FindOrCreateTicketService = async (
//[Op.between]: [+subHours(new Date(), 2), +new Date()]
// Tempo osioso para a ura responder thuanny
//[Op.between]: [+subMinutes(new Date(), 30), +new Date()]
[Op.between]: [+subMinutes(new Date(), 30), +new Date()]
// Sub seconds
[Op.between]: [+subSeconds(new Date(), 3), +new Date()]
// [Op.between]: [+subSeconds(new Date(), 3), +new Date()]
},
contactId: contact.id
},

View File

@ -362,6 +362,18 @@ const handleMessage = async (
groupContact
);
// test del
// console.log('>>>>>>>>>>>>>> wbot MOBILE NUMBER: ', wbot.info["wid"]["user"])
// console.log('>>>>>>>>>>>>>> wbot.id: ', wbot.id)
// console.log('>>>>>>>>>>>>>> ticket.id: ', ticket.id)
// console.log('>>>>>>>>>>>>>> ticket.whatsappId: ', ticket.whatsappId)
// Para responder para o cliente pelo mesmo whatsapp que ele enviou a mensagen
if(wbot.id != ticket.whatsappId){
await ticket.update({ whatsappId: wbot.id });
}
//
if (msg.hasMedia) {
await verifyMediaMessage(msg, ticket, contact);