Adição de código para extrair numero
parent
0f3a0cdc0e
commit
9f3183f8ce
|
@ -160,14 +160,19 @@ const verifyQueue = async (
|
|||
choosenQueue = queues[+selectedOption - 1];
|
||||
}
|
||||
else{
|
||||
|
||||
selectedOption = msg.body;
|
||||
|
||||
//////////////// EXTRAIR APENAS O NÚMERO ///////////////////
|
||||
selectedOption = selectedOption.replace(/[^1-9]/g, '')
|
||||
///////////////////////////////////
|
||||
|
||||
choosenQueue = queues[+selectedOption - 1];
|
||||
}
|
||||
|
||||
// const selectedOption = msg.body;
|
||||
// const choosenQueue = queues[+selectedOption - 1];
|
||||
|
||||
|
||||
if (choosenQueue) {
|
||||
await UpdateTicketService({
|
||||
ticketData: { queueId: choosenQueue.id },
|
||||
|
@ -190,10 +195,7 @@ const verifyQueue = async (
|
|||
|
||||
const debouncedSentMessage = debounce(
|
||||
async () => {
|
||||
const sentMessage = await wbot.sendMessage(
|
||||
`${contact.number}@c.us`,
|
||||
body
|
||||
);
|
||||
const sentMessage = await wbot.sendMessage(`${contact.number}@c.us`, body);
|
||||
verifyMessage(sentMessage, ticket, contact);
|
||||
},
|
||||
3000,
|
||||
|
|
Loading…
Reference in New Issue