mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-19 20:19:15 +00:00
fix(bot): 🔥 fix rev
This commit is contained in:
@@ -8,10 +8,7 @@ class FlowClass {
|
||||
if (!Array.isArray(_flow)) throw new Error('Esto debe ser un ARRAY')
|
||||
this.flowRaw = _flow
|
||||
|
||||
this.allCallbacks = _flow
|
||||
.map((cbIn) => cbIn.ctx.callbacks)
|
||||
.flat(2)
|
||||
.map((c, i) => ({ callback: c?.callback, index: i }))
|
||||
this.getAllCb(this.flowRaw)
|
||||
|
||||
const mergeToJsonSerialize = Object.keys(_flow)
|
||||
.map((indexObjectFlow) => _flow[indexObjectFlow].toJson())
|
||||
@@ -20,6 +17,17 @@ class FlowClass {
|
||||
this.flowSerialize = toSerialize(mergeToJsonSerialize)
|
||||
}
|
||||
|
||||
/**
|
||||
* Buscar y aplanar todos los callbacks
|
||||
* @param {*} inFlow
|
||||
*/
|
||||
getAllCb = (inFlow) => {
|
||||
this.allCallbacks = inFlow
|
||||
.map((cbIn) => cbIn.ctx.callbacks)
|
||||
.flat(2)
|
||||
.map((c, i) => ({ callback: c?.callback, index: i }))
|
||||
}
|
||||
|
||||
find = (keyOrWord, symbol = false, overFlow = null) => {
|
||||
keyOrWord = `${keyOrWord}`
|
||||
let capture = false
|
||||
|
||||
Reference in New Issue
Block a user