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