mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-20 12:39:24 +00:00
rollup
This commit is contained in:
@@ -8,8 +8,10 @@
|
||||
|
||||
> `sensitivy` false _default_
|
||||
|
||||
- [ ] addKeyword
|
||||
- [ ] addAnswer
|
||||
- [x] addKeyword
|
||||
- [x] addAnswer
|
||||
- [ ] addKeyword: Opciones
|
||||
- [ ] addAnswer: Opciones
|
||||
- [ ] Si ha contactado previamente. Seguir continuida
|
||||
|
||||
```js
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
const { addKeyword, addAnswer } = require('./methods')
|
||||
module.exports = { addKeyword, addAnswer }
|
||||
// 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 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')
|
||||
|
||||
const test1 = async () => {
|
||||
const cxtAB = addKeyword('hola').addAnswer('b').addAnswer('c')
|
||||
// console.log({
|
||||
// keyword: cxtAB.ctx.keyword,
|
||||
// anwser: cxtAB.ctx.message,
|
||||
// })
|
||||
// }
|
||||
|
||||
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*')
|
||||
|
||||
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,
|
||||
// })
|
||||
// }
|
||||
|
||||
console.log({
|
||||
pregunta: cxtABB.ctx.keyword,
|
||||
ultimasrespuesta: cxtABB.ctx.message,
|
||||
})
|
||||
}
|
||||
|
||||
test2().then()
|
||||
// test2().then()
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"io:dev": "node ./index.js",
|
||||
"io:rollup": "rollup index.js --config ./rollup-cli.config.js",
|
||||
"io:rollup": "node ../../node_modules/.bin/rollup index.js --config ./rollup-cli.config.js",
|
||||
"format:check": "prettier --check .",
|
||||
"format:write": "prettier --write .",
|
||||
"lint:check": "eslint .",
|
||||
|
||||
10
packages/io/rollup-cli.config.js
Normal file
10
packages/io/rollup-cli.config.js
Normal file
@@ -0,0 +1,10 @@
|
||||
const commonjs = require('@rollup/plugin-commonjs')
|
||||
|
||||
module.exports = {
|
||||
input: 'index.js',
|
||||
output: {
|
||||
file: 'lib/io/bundle.cjs',
|
||||
format: 'cjs',
|
||||
},
|
||||
plugins: [commonjs()],
|
||||
}
|
||||
12
packages/io/tests/methods.test.js
Normal file
12
packages/io/tests/methods.test.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const { test, suite } = require('uvu')
|
||||
const { snapshot } = require('uvu/assert')
|
||||
|
||||
const botTest = suite('bot-function')
|
||||
|
||||
test(``, async () => {
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
botTest.run()
|
||||
Reference in New Issue
Block a user