diff --git a/packages/cli/package.json b/packages/cli/package.json index 5a0e787..e163a5d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -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" } } diff --git a/packages/io/TODO.md b/packages/io/TODO.md index c8b6f38..04567d1 100644 --- a/packages/io/TODO.md +++ b/packages/io/TODO.md @@ -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 \ No newline at end of file diff --git a/packages/io/index.js b/packages/io/index.js new file mode 100644 index 0000000..e69de29 diff --git a/packages/io/keyword/addKeyword.js b/packages/io/keyword/addKeyword.js new file mode 100644 index 0000000..dc45e81 --- /dev/null +++ b/packages/io/keyword/addKeyword.js @@ -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']) \ No newline at end of file diff --git a/packages/io/keyword/index.js b/packages/io/keyword/index.js new file mode 100644 index 0000000..e69de29 diff --git a/packages/io/package.json b/packages/io/package.json new file mode 100644 index 0000000..aec99b4 --- /dev/null +++ b/packages/io/package.json @@ -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": { + + } +} \ No newline at end of file