Adição de código para extrair numero

pull/1/head
adriano 2022-03-16 20:44:10 -03:00
parent 0f3a0cdc0e
commit 9f3183f8ce
1 changed files with 8 additions and 6 deletions

View File

@ -160,13 +160,18 @@ 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];
// const choosenQueue = queues[+selectedOption - 1];
if (choosenQueue) {
await UpdateTicketService({
@ -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,