mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-20 20:49:15 +00:00
...
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "cli",
|
"name": "cli",
|
||||||
"version": "1.0.0",
|
"version": "0.0.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
"private":true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"cli:dev": "NODE_ENV=dev node ./index.js",
|
"cli:dev": "NODE_ENV=dev node ./index.js",
|
||||||
"cli:rollup": "rollup index.js --config ./rollup-cli.config.js",
|
"cli:rollup": "rollup index.js --config ./rollup-cli.config.js",
|
||||||
@@ -21,8 +22,5 @@
|
|||||||
"kleur": "^4.1.5",
|
"kleur": "^4.1.5",
|
||||||
"prompts": "^2.4.2",
|
"prompts": "^2.4.2",
|
||||||
"rimraf": "^3.0.2"
|
"rimraf": "^3.0.2"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"whatsapp-web.js": "^1.18.2"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,16 @@
|
|||||||
# @bot-whatsapp/io
|
# @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
|
```js
|
||||||
// bootstrap.js Como iniciar el provider
|
// bootstrap.js Como iniciar el provider
|
||||||
const { inout, provider, database } = require('@bot-whatsapp')
|
const { inout, provider, database } = require('@bot-whatsapp')
|
||||||
@@ -82,10 +93,3 @@ answerOne.push(otherAnswer)
|
|||||||
inout.addKeywords(['hola','hi','ola'])
|
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
0
packages/io/index.js
Normal file
16
packages/io/keyword/addKeyword.js
Normal file
16
packages/io/keyword/addKeyword.js
Normal 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'])
|
||||||
0
packages/io/keyword/index.js
Normal file
0
packages/io/keyword/index.js
Normal file
22
packages/io/package.json
Normal file
22
packages/io/package.json
Normal 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": {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user