This commit is contained in:
Leifer
2022-10-29 12:15:05 +02:00
parent 1e9574e740
commit 5974f3c9f2
6 changed files with 51 additions and 11 deletions

View File

@@ -1,8 +1,9 @@
{
"name": "cli",
"version": "1.0.0",
"version": "0.0.1",
"description": "",
"main": "index.js",
"private":true,
"scripts": {
"cli:dev": "NODE_ENV=dev node ./index.js",
"cli:rollup": "rollup index.js --config ./rollup-cli.config.js",
@@ -21,8 +22,5 @@
"kleur": "^4.1.5",
"prompts": "^2.4.2",
"rimraf": "^3.0.2"
},
"dependencies": {
"whatsapp-web.js": "^1.18.2"
}
}

View File

@@ -1,5 +1,16 @@
# @bot-whatsapp/io
### Caso de uso
> Una persona escribe `hola`
__addKeyword__ recibe `string | string[]`
> `sensitivy` false _default_
- [] addKeyword
- [] addAnswer
- [] Si ha contactado previamente. Seguir continuida
```js
// bootstrap.js Como iniciar el provider
const { inout, provider, database } = require('@bot-whatsapp')
@@ -82,10 +93,3 @@ answerOne.push(otherAnswer)
inout.addKeywords(['hola','hi','ola'])
```
### Caso de uso
> Una persona escribe `hola`
- [] Revisar si en las ultimas 24 ha contactado
- [] Si no INICIAR hilo
- [] Si ha contactado previamente. Seguir continuida

0
packages/io/index.js Normal file
View File

View File

@@ -0,0 +1,16 @@
/**
*
* @param {*} message `string | string[]`
* @param {*} options {sensitivy:boolean} defaulta false
*/
const addKeyword = (message, options) => {
if (typeof message === 'string') return 1
return 0
}
module.exports = { addKeyword }
// await inout.addKeyword('hola')
// .addAnswer('Bienvenido a tu tienda 🥲')
// .addAnswer('escribe *catalogo* o *ofertas*')
// await inout.addKeyword(['catalogo','ofertas'])

View File

22
packages/io/package.json Normal file
View File

@@ -0,0 +1,22 @@
{
"name": "io",
"version": "0.0.1",
"description": "",
"main": "index.js",
"private": true,
"scripts": {
"io:dev": "NODE_ENV=dev node ./index.js",
"io:rollup": "rollup index.js --config ./rollup-cli.config.js",
"format:check": "prettier --check .",
"format:write": "prettier --write .",
"lint:check": "eslint .",
"lint:fix": "eslint --fix .",
"build:io": "npm run format:write && npm run lint:fix && npm run io:rollup"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
}
}