mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-19 03:59:17 +00:00
io improvement
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
const { addKeyword, addAnswer } = require('./methods')
|
||||
|
||||
const test = async () => {
|
||||
const cxtA = addKeyword('hola')
|
||||
console.log({ cxtA: cxtA.ctx.keyword, ref: cxtA.ref })
|
||||
const cxtB = addAnswer(cxtA)('b')
|
||||
console.log({ cxtB: cxtB.ctx.message, ref: cxtB.ref })
|
||||
const cxtC = addAnswer(cxtB)('c')
|
||||
console.log({ cxtC: cxtC.ctx.keyword, ref: cxtC.ref })
|
||||
}
|
||||
|
||||
const test1 = async () => {
|
||||
const cxtAB = addKeyword('hola').addAnswer('b').addAnswer('c')
|
||||
|
||||
console.log({
|
||||
keyword: cxtAB.ctx.keyword,
|
||||
anwser: cxtAB.ctx.message,
|
||||
})
|
||||
}
|
||||
|
||||
const test2 = async () => {
|
||||
const cxtABB = addKeyword('hola')
|
||||
.addAnswer('Bienvenido a tu tienda 🥲')
|
||||
.addAnswer('escribe *catalogo* o *ofertas*')
|
||||
|
||||
console.log({
|
||||
pregunta: cxtABB.ctx.keyword,
|
||||
ultimasrespuesta: cxtABB.ctx.message,
|
||||
})
|
||||
}
|
||||
|
||||
test2().then()
|
||||
|
||||
Reference in New Issue
Block a user