This commit is contained in:
Leifer Mendez
2022-11-08 21:41:16 +01:00
parent 2114800b84
commit 576092fc96
26 changed files with 408 additions and 801 deletions

View File

@@ -0,0 +1,20 @@
class FlowClass {
flow
constructor(_flow) {
this.flow = _flow
}
find = (message, ref = false) => {
let keyRef = ref
let ansRef = null
if (!keyRef) {
keyRef =
this.flow.find((n) => n.keyword.includes(message))?.ref || null
}
ansRef = this.flow.find((n) => n.keyword === keyRef)
if (ansRef) return ansRef
return false
}
}
module.exports = FlowClass