@bot-whatsapp/bot
Advanced tools
Comparing version 0.0.166-alpha.0 to 0.0.167-alpha.0
@@ -175,3 +175,5 @@ const { toCtx } = require('../io/methods') | ||
// 📄 Esta funcion se encarga de enviar un array de mensajes dentro de este ctx | ||
const sendFlow = async (messageToSend, numberOrId, options = { prev: prevMsg, forceQueue: false }) => { | ||
const sendFlow = async (messageToSend, numberOrId, options = {}) => { | ||
options = { prev: prevMsg, forceQueue: false, ...options } | ||
if (options.prev?.options?.capture) { | ||
@@ -199,6 +201,7 @@ await cbEveryCtx(options.prev?.ref) | ||
} else { | ||
this.queuePrincipal.clearQueue(from) | ||
const lastMessage = messageToSend[messageToSend.length - 1] | ||
await this.databaseClass.save({ ...lastMessage, from: numberOrId }) | ||
if (listProcessWait.includes(lastMessage.ref)) return | ||
if (listProcessWait.includes(lastMessage.ref)) { | ||
this.queuePrincipal.clearQueue(from); | ||
} | ||
} | ||
@@ -240,3 +243,3 @@ } | ||
await sendFlow(filterNextFlow, from, { prev: undefined, forceQueue: true }) | ||
await sendFlow(filterNextFlow, from, { prev: undefined }) | ||
return | ||
@@ -388,3 +391,3 @@ } | ||
} | ||
return sendFlow(msgToSend, from) | ||
return sendFlow(msgToSend, from, {forceQueue:true}) | ||
} | ||
@@ -391,0 +394,0 @@ |
{ | ||
"name": "@bot-whatsapp/bot", | ||
"version": "0.0.166-alpha.0", | ||
"version": "0.0.167-alpha.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/bundle.bot.cjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117774
3087