mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-17 19:26:23 +00:00
nothing
This commit is contained in:
@@ -1,17 +1,12 @@
|
||||
const { toSerialize } = require('./methods')
|
||||
|
||||
class FlowClass {
|
||||
allContexts = []
|
||||
allCallbacks = []
|
||||
flowSerialize = []
|
||||
flowRaw = []
|
||||
constructor(_flow) {
|
||||
if (!Array.isArray(_flow)) throw new Error('Esto debe ser un ARRAY')
|
||||
this.flowRaw = _flow
|
||||
this.allContexts = _flow
|
||||
.map((ctxs) => ctxs.ctx.contexts)
|
||||
.flat(2)
|
||||
.map((c, i) => ({ getCtx: c?.getCtx, index: i }))
|
||||
|
||||
this.allCallbacks = _flow
|
||||
.map((cbIn) => cbIn.ctx.callbacks)
|
||||
|
||||
@@ -52,13 +52,6 @@ const addAnswer =
|
||||
},
|
||||
])
|
||||
|
||||
const contexts = [].concat(inCtx.contexts).concat([
|
||||
{
|
||||
ref: lastCtx.ref,
|
||||
getCtx: () => lastCtx,
|
||||
},
|
||||
])
|
||||
|
||||
return {
|
||||
...lastCtx,
|
||||
ref,
|
||||
@@ -66,7 +59,6 @@ const addAnswer =
|
||||
json,
|
||||
options,
|
||||
callbacks,
|
||||
contexts,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user