commit test
parent
728c5b580e
commit
12c497f65b
|
@ -36,23 +36,23 @@ const monitor = async () => {
|
|||
|
||||
try {
|
||||
|
||||
const { schedulingNotifies, count, hasMore } = await ListSchedulingNotifyService({ searchParam: dateParm, pageNumber: "1" });
|
||||
// const { schedulingNotifies, count, hasMore } = await ListSchedulingNotifyService({ searchParam: dateParm, pageNumber: "1" });
|
||||
|
||||
// console.log('schedulingNotifies: ',schedulingNotifies)
|
||||
// // console.log('schedulingNotifies: ',schedulingNotifies)
|
||||
|
||||
if (schedulingNotifies && schedulingNotifies.length > 0) {
|
||||
// if (schedulingNotifies && schedulingNotifies.length > 0) {
|
||||
|
||||
const ticket = await ShowTicketService(schedulingNotifies[0].ticketId);
|
||||
// const ticket = await ShowTicketService(schedulingNotifies[0].ticketId);
|
||||
|
||||
SetTicketMessagesAsRead(ticket);
|
||||
// SetTicketMessagesAsRead(ticket);
|
||||
|
||||
await SendWhatsAppMessage({
|
||||
body: schedulingNotifies[0].message, ticket
|
||||
});
|
||||
// await SendWhatsAppMessage({
|
||||
// body: schedulingNotifies[0].message, ticket
|
||||
// });
|
||||
|
||||
DeleteSchedulingNotifyService(schedulingNotifies[0].id)
|
||||
// DeleteSchedulingNotifyService(schedulingNotifies[0].id)
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
exec("df -h /", (error: any, stdout: any, stderr: any) => {
|
||||
|
|
|
@ -24,10 +24,9 @@ const FindOrCreateTicketService = async (
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
const { queues, greetingMessage } = await ShowWhatsAppService(whatsappId);
|
||||
|
||||
|
||||
//Habilitar esse caso queira usar o bot
|
||||
// const botInfo = await BotIsOnQueue('botqueue')
|
||||
const botInfo = {isOnQueue: false}
|
||||
|
@ -69,7 +68,7 @@ const FindOrCreateTicketService = async (
|
|||
//[Op.between]: [+subMinutes(new Date(), 30), +new Date()]
|
||||
|
||||
// Sub seconds
|
||||
[Op.between]: [+subSeconds(new Date(), 3), +new Date()]
|
||||
[Op.between]: [+subSeconds(new Date(), 0), +new Date()]
|
||||
},
|
||||
contactId: contact.id
|
||||
},
|
||||
|
|
|
@ -424,14 +424,11 @@ 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) {
|
||||
|
||||
console.log('>>> entrou wbot.id: ', wbot.id, ' | ',ticket.whatsappId)
|
||||
|
||||
await ticket.update({ whatsappId: wbot.id });
|
||||
}
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue