mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-18 03:29:15 +00:00
fix(bot): ⚡ working callback Phase 1
This commit is contained in:
@@ -115,24 +115,16 @@ class CoreClass {
|
||||
|
||||
// 📄 Se encarga de revisar si el contexto del mensaje tiene callback y ejecutarlo
|
||||
const cbEveryCtx = (inRef) => {
|
||||
const indexFlow = this.flowClass.findIndexByRef(inRef)
|
||||
this.flowClass.allCallbacks[indexFlow].callback(
|
||||
messageCtxInComming,
|
||||
{
|
||||
fallBack,
|
||||
flowDynamic,
|
||||
}
|
||||
)
|
||||
this.flowClass.allCallbacks[inRef](messageCtxInComming, {
|
||||
fallBack,
|
||||
flowDynamic,
|
||||
})
|
||||
}
|
||||
|
||||
// 📄 [options: callback]: Si se tiene un callback se ejecuta
|
||||
if (!fallBackFlag) {
|
||||
if (refToContinue && prevMsg?.options?.callback) {
|
||||
cbEveryCtx(refToContinue?.ref)
|
||||
} else {
|
||||
for (const ite of this.flowClass.find(body)) {
|
||||
cbEveryCtx(ite?.ref)
|
||||
}
|
||||
for (const ite of this.flowClass.find(body)) {
|
||||
cbEveryCtx(ite?.ref)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user