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