mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-20 12:39:24 +00:00
docs: 📝 meta added
docs: 📝 meta added
This commit is contained in:
1
.github/workflows/netlify.yml
vendored
1
.github/workflows/netlify.yml
vendored
@@ -3,7 +3,6 @@ name: 📄 (PROD) Desplegando documentacion
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
|
||||||
- next-release
|
- next-release
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
41
.github/workflows/releases.yml
vendored
41
.github/workflows/releases.yml
vendored
@@ -2,9 +2,8 @@ name: 🚀⚡ Liberando versiones
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
branches:
|
||||||
- 'pre-v*.*.*'
|
- production-release
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
############ RELEASE ############
|
############ RELEASE ############
|
||||||
release:
|
release:
|
||||||
@@ -27,38 +26,42 @@ jobs:
|
|||||||
|
|
||||||
- run: corepack enable
|
- run: corepack enable
|
||||||
|
|
||||||
|
- name: Set User
|
||||||
|
run: git config --global user.email "leifer.contacto@gmail.com" && git config --global user.name "Leifer Mendez"
|
||||||
|
|
||||||
- name: Install NPM Dependencies
|
- name: Install NPM Dependencies
|
||||||
run: yarn install --immutable --network-timeout 300000
|
run: yarn install --immutable --network-timeout 300000
|
||||||
|
|
||||||
|
- name: Set CHANGELOG
|
||||||
|
run: yarn release
|
||||||
|
|
||||||
|
- name: get-npm-version
|
||||||
|
id: package-version
|
||||||
|
uses: martinbeentjes/npm-get-version-action@main
|
||||||
|
|
||||||
- name: Build Package
|
- name: Build Package
|
||||||
run: yarn build:full
|
run: yarn build:full
|
||||||
|
|
||||||
- name: Release @bot-whatsapp/bot
|
- name: Release @bot-whatsapp/bot
|
||||||
run: yarn node ./scripts/release.js --name=bot --version="${{ steps.vars.outputs.tag }}" --token="${{ secrets.NPM_TOKEN }}"
|
run: yarn node ./scripts/release.js --name=bot --version="${{ steps.package-version.outputs.current-version}}" --token="${{ secrets.NPM_TOKEN }}"
|
||||||
|
|
||||||
- name: Release @bot-whatsapp/cli
|
- name: Release @bot-whatsapp/cli
|
||||||
run: yarn node ./scripts/release.js --name=cli --version="${{ steps.vars.outputs.tag }}" --token="${{ secrets.NPM_TOKEN }}"
|
run: yarn node ./scripts/release.js --name=cli --version="${{ steps.package-version.outputs.current-version}}" --token="${{ secrets.NPM_TOKEN }}"
|
||||||
|
|
||||||
- name: Release @bot-whatsapp/create-bot-whatsapp
|
- name: Release @bot-whatsapp/create-bot-whatsapp
|
||||||
run: yarn node ./scripts/release.js --name=create-bot-whatsapp --version="${{ steps.vars.outputs.tag }}" --token="${{ secrets.NPM_TOKEN }}"
|
run: yarn node ./scripts/release.js --name=create-bot-whatsapp --version="${{ steps.package-version.outputs.current-version}}" --token="${{ secrets.NPM_TOKEN }}"
|
||||||
|
|
||||||
- name: Release @bot-whatsapp/database
|
- name: Release @bot-whatsapp/database
|
||||||
run: yarn node ./scripts/release.js --name=database --version="${{ steps.vars.outputs.tag }}" --token="${{ secrets.NPM_TOKEN }}"
|
run: yarn node ./scripts/release.js --name=database --version="${{ steps.package-version.outputs.current-version}}" --token="${{ secrets.NPM_TOKEN }}"
|
||||||
|
|
||||||
- name: Release @bot-whatsapp/provider
|
- name: Release @bot-whatsapp/provider
|
||||||
run: yarn node ./scripts/release.js --name=provider --version="${{ steps.vars.outputs.tag }}" --token="${{ secrets.NPM_TOKEN }}"
|
run: yarn node ./scripts/release.js --name=provider --version="${{ steps.package-version.outputs.current-version}}" --token="${{ secrets.NPM_TOKEN }}"
|
||||||
|
|
||||||
- name: Release @bot-whatsapp/portal
|
- name: Release @bot-whatsapp/portal
|
||||||
run: yarn node ./scripts/release.js --name=portal --version="${{ steps.vars.outputs.tag }}" --token="${{ secrets.NPM_TOKEN }}"
|
run: yarn node ./scripts/release.js --name=portal --version="${{ steps.package-version.outputs.current-version}}" --token="${{ secrets.NPM_TOKEN }}"
|
||||||
|
|
||||||
- name: Set User
|
- name: Commit and push changes
|
||||||
run: git config --global user.email "leifer.contacto@gmail.com" && git config --global user.name "Leifer Mendez"
|
uses: devops-infra/action-commit-push@master
|
||||||
|
|
||||||
- name: Set CHANGELOG
|
|
||||||
run: yarn release
|
|
||||||
|
|
||||||
- name: Commit Versioning & Push changes
|
|
||||||
uses: stefanzweifel/git-auto-commit-action@v4
|
|
||||||
with:
|
with:
|
||||||
commit_message: 'release(version): 🚀 - "${{ steps.vars.outputs.tag }}" release'
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
branch: dev
|
commit_message: 'release(version): 🚀 - "${{ steps.package-version.outputs.current-version}}" release'
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
### [0.1.8](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.7-pre...v0.1.8) (2023-01-10)
|
||||||
|
|
||||||
|
### [0.1.7](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.7-pre...v0.1.7) (2023-01-10)
|
||||||
|
|
||||||
### [0.1.6](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.5...v0.1.6) (2023-01-10)
|
### [0.1.6](https://github.com/leifermendez/bot-whatsapp/compare/v0.1.5...v0.1.6) (2023-01-10)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@bot-whatsapp/root",
|
"name": "@bot-whatsapp/root",
|
||||||
"version": "0.1.6",
|
"version": "0.1.8",
|
||||||
"description": "Bot de wahtsapp open source para MVP o pequeños negocios",
|
"description": "Bot de wahtsapp open source para MVP o pequeños negocios",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
@@ -39,6 +39,12 @@ Estamos trabajando en el apartado de la documentación lo más claro posible. Pu
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### Meta: Configuración
|
||||||
|
|
||||||
|
Estamos trabajando en el apartado de la documentación lo más claro posible. Puedes encontrar los [detalles aquí](/docs/providers/meta)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
<Navigation
|
<Navigation
|
||||||
pages={[
|
pages={[
|
||||||
{ name: 'Conversaciones', link: '/docs/providers' },
|
{ name: 'Conversaciones', link: '/docs/providers' },
|
||||||
|
|||||||
@@ -1,3 +1,159 @@
|
|||||||
|
import Alert from '../../../../components/widgets/Alert'
|
||||||
|
import Navigation from '../../../../components/widgets/Navigation'
|
||||||
|
|
||||||
# Meta
|
# Meta
|
||||||
|
|
||||||
...
|
La Plataforma de WhatsApp Business permite a medianas y grandes empresas comunicarse con sus clientes a gran escala.
|
||||||
|
Puedes iniciar conversaciones con clientes en apenas unos minutos, enviarles notificaciones de atención al cliente o actualizaciones de compras, ofrecerles un nivel de servicio personalizado y
|
||||||
|
prestarles ayuda a través del canal que ellos prefieran.
|
||||||
|
|
||||||
|
### Requerimientos
|
||||||
|
|
||||||
|
- Registrar una cuenta de [facebook developers](https://developers.facebook.com/apps)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Requerimientos
|
||||||
|
|
||||||
|
Debes crear una aplicación nueva. Para ello haz clic en el botón **Crear aplicación**
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
En esta pantalla debes de seleccionar **Empresa o Business**
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
En el siguiente paso debes escribir un nombre al tu aplicación también colocar un email de contacto y seleccionar la aplicación de Test Business
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Ahora dirígete a la sección de Ajustes de WhatsApp.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Está la parte donde encontraras el token acceso y también puedes ver el número **desde donde** se envía los mensajes de WhatsApp
|
||||||
|
y **a donde** se va a enviar.
|
||||||
|
Como estás en la versión de prueba, deberás dar de alta los números a los que quieres enviar.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
En esta misma página puedes encontrar el apartado de **Webhook** que pronto necesitaremos usar
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
En el **archivo principal** del bot donde estás implementando la función del adaptador de meta vas a colocar los siguientes datos:
|
||||||
|
|
||||||
|
- **numberId:** Lo puedes encontrar en la pagina anterior
|
||||||
|
- **jwtToken:** Lo puedes encontrar en la pagina anterior
|
||||||
|
- **verifyToken:** Puedes escribir lo que quieras es como una palabra clave
|
||||||
|
|
||||||
|
<Alert>
|
||||||
|
En el ejemplo de abajo puedes ver como una sugerencia de como puede ser
|
||||||
|
utilizando variables de entorno
|
||||||
|
</Alert>
|
||||||
|
|
||||||
|
```js
|
||||||
|
const main = async () => {
|
||||||
|
const adapterDB = new MockAdapter()
|
||||||
|
const adapterFlow = createFlow([flowPrincipal])
|
||||||
|
|
||||||
|
const adapterProvider = createProvider(MetaProvider, {
|
||||||
|
jwtToken: process.env.JWTOKEN, //EAARBW3ZBGU0UBAACDjtQIzI8JuEa.............
|
||||||
|
numberId: process.env.NUMBER_ID, //103975305758520
|
||||||
|
verifyToken: process.env.VERIFY_TOKEN, //LO_QUE_SEA
|
||||||
|
})
|
||||||
|
|
||||||
|
createBot({
|
||||||
|
flow: adapterFlow,
|
||||||
|
provider: adapterProvider,
|
||||||
|
database: adapterDB,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Luego de ejecutar el bot encontraras un mensaje en la consola similar al siguiente.
|
||||||
|
Donde podrás encontrar la URL para tu **webhook**
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ npm start
|
||||||
|
|
||||||
|
> bot-whatsapp-base-meta-memory@1.0.0 start
|
||||||
|
> node app.js
|
||||||
|
|
||||||
|
|
||||||
|
[meta]: Agregar esta url "WHEN A MESSAGE COMES IN"
|
||||||
|
[meta]: POST http://localhost:3000/webhook
|
||||||
|
[meta]: Más información en la documentacion
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ¿Ahora que hago?
|
||||||
|
|
||||||
|
Podrás observar que el bot inicia un servicio HTTP (endpoint) que debe estar en un servidor en linea para que puedas conectarlo con Meta.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Opción 1:
|
||||||
|
|
||||||
|
Puedes hacer pruebas en local atrevés de un servidor proxy tunnel.
|
||||||
|
Descarga **[ngork](https://ngrok.com/download)** es una herramienta gratuita que nos ayudara con esto.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Esto genera una URL en línea que podemos usar en la parte de **WebHook** de Meta
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Opción 2:
|
||||||
|
|
||||||
|
Si ya tienes desplegado tu bot en un servidor tienes que obtener la IP publica o subdominio que te proporcionaron. **Ejemplo** si estas usando
|
||||||
|
[Railway](https://railway.app/) puedes ir a la seccion de ajustes y generar un subdominio. Ya tendriamos el **WebHook**
|
||||||
|
`https://base-twilio-memory-production.up.railway.app/twilio-hook`
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<Navigation
|
||||||
|
pages={[
|
||||||
|
{ name: 'Proveedores', link: '/docs/providers' },
|
||||||
|
{ name: 'Meta', link: '/docs/providers/meta' },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
FROM node:lts-bullseye as bot
|
FROM node:18-bullseye as bot
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm i
|
RUN npm i
|
||||||
COPY . .
|
COPY . .
|
||||||
|
ARG RAILWAY_STATIC_URL
|
||||||
|
ARG PUBLIC_URL
|
||||||
ARG PORT
|
ARG PORT
|
||||||
CMD ["npm", "start"]
|
CMD ["npm", "start"]
|
||||||
|
|||||||
@@ -5,26 +5,8 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
**Con esta librería, puedes construir flujos automatizados de conversación de manera agnóstica al proveedor de WhatsApp,** configurar respuestas automatizadas para preguntas frecuentes, recibir y responder mensajes de manera automatizada, y hacer un seguimiento de las interacciones con los clientes. Además, puedes configurar fácilmente disparadores que te ayudaran a expandir las funcionalidades sin límites. **[Ver más informacion](https://bot-whatsapp.netlify.app/)**
|
**Con esta librería, puedes construir flujos automatizados de conversación de manera agnóstica al proveedor de WhatsApp,** configurar respuestas automatizadas para preguntas frecuentes, recibir y responder mensajes de manera automatizada, y hacer un seguimiento de las interacciones con los clientes. Además, puedes configurar fácilmente disparadores que te ayudaran a expandir las funcionalidades sin límites. **[Ver documentación](https://bot-whatsapp.netlify.app/)**
|
||||||
|
|
||||||
```js
|
|
||||||
const main = async () => {
|
|
||||||
const adapterDB = new MockAdapter()
|
|
||||||
const adapterFlow = createFlow([flowPrincipal])
|
|
||||||
|
|
||||||
const adapterProvider = createProvider(BaileysProvider, {
|
|
||||||
accountSid: process.env.ACC_SID,
|
|
||||||
authToken: process.env.ACC_TOKEN,
|
|
||||||
vendorNumber: process.env.ACC_VENDOR,
|
|
||||||
})
|
|
||||||
|
|
||||||
createBot({
|
|
||||||
flow: adapterFlow,
|
|
||||||
provider: adapterProvider,
|
|
||||||
database: adapterDB,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
```
|
||||||
npm install
|
npm install
|
||||||
|
|||||||
@@ -5,86 +5,62 @@ const {
|
|||||||
addKeyword,
|
addKeyword,
|
||||||
} = require('@bot-whatsapp/bot')
|
} = require('@bot-whatsapp/bot')
|
||||||
|
|
||||||
require('./server.http')
|
const QRPortalWeb = require('@bot-whatsapp/portal')
|
||||||
|
|
||||||
const BaileysProvider = require('@bot-whatsapp/provider/baileys')
|
const BaileysProvider = require('@bot-whatsapp/provider/baileys')
|
||||||
const JsonFileAdapter = require('@bot-whatsapp/database/json')
|
const JsonFileAdapter = require('@bot-whatsapp/database/json')
|
||||||
|
|
||||||
/**
|
const flowDocs = addKeyword([
|
||||||
* Aqui declaramos los flujos hijos, los flujos se declaran de atras para adelante, es decir que si tienes un flujo de este tipo:
|
'doc',
|
||||||
*
|
'documentacion',
|
||||||
* Menu Principal
|
'documentación',
|
||||||
* - SubMenu 1
|
]).addAnswer([
|
||||||
* - Submenu 1.1
|
'📄 Aquí encontras las documentación recuerda que puedes mejorarla',
|
||||||
* - Submenu 2
|
'https://bot-whatsapp.netlify.app/',
|
||||||
* - Submenu 2.1
|
])
|
||||||
*
|
|
||||||
* Primero declaras los submenus 1.1 y 2.1, luego el 1 y 2 y al final el principal.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const flowBolsos2 = addKeyword(['bolsos2', '2'])
|
const flowTuto = addKeyword(['tutorial', 'tuto']).addAnswer([
|
||||||
.addAnswer('🤯 *MUCHOS* bolsos ...')
|
'🙌 Aquí encontras un ejemplo rapido',
|
||||||
.addAnswer('y mas bolsos... bla bla')
|
'https://bot-whatsapp.netlify.app/docs/example/',
|
||||||
|
])
|
||||||
|
|
||||||
const flowZapatos2 = addKeyword(['zapatos2', '2'])
|
const flowGracias = addKeyword(['gracias', 'grac']).addAnswer([
|
||||||
.addAnswer('🤯 repito que tengo *MUCHOS* zapatos.')
|
'🚀 Puedes aportar tu granito de arena a este proyecto',
|
||||||
.addAnswer('y algunas otras cosas.')
|
'[*opencollective*] https://opencollective.com/bot-whatsapp',
|
||||||
|
'[*buymeacoffee*] https://www.buymeacoffee.com/leifermendez',
|
||||||
|
'[*patreon*] https://www.patreon.com/leifermendez',
|
||||||
|
])
|
||||||
|
|
||||||
const flowZapatos = addKeyword(['1', 'zapatos', 'ZAPATOS'])
|
const flowDiscord = addKeyword(['discord']).addAnswer([
|
||||||
.addAnswer('🤯 Veo que elegiste zapatos')
|
'🤪 Únete al discord',
|
||||||
.addAnswer('Tengo muchos zapatos...bla bla')
|
'https://link.codigoencasa.com/DISCORD',
|
||||||
.addAnswer(
|
])
|
||||||
['Manda:', '*(2) Zapatos2*', 'para mas información'],
|
|
||||||
{ capture: true },
|
|
||||||
(ctx) => {
|
|
||||||
console.log('Aqui puedes ver más info del usuario...')
|
|
||||||
console.log('Puedes enviar un mail, hook, etc..')
|
|
||||||
console.log(ctx)
|
|
||||||
},
|
|
||||||
[flowZapatos2]
|
|
||||||
)
|
|
||||||
|
|
||||||
const flowBolsos = addKeyword(['2', 'bolsos', 'BOLSOS'])
|
|
||||||
.addAnswer('🙌 Veo que elegiste bolsos')
|
|
||||||
.addAnswer('Tengo muchos bolsos...bla bla')
|
|
||||||
.addAnswer(
|
|
||||||
['Manda:', '*(2) Bolsos2*', 'para mas información.'],
|
|
||||||
{ capture: true },
|
|
||||||
(ctx) => {
|
|
||||||
console.log('Aqui puedes ver más info del usuario...')
|
|
||||||
console.log('Puedes enviar un mail, hook, etc..')
|
|
||||||
console.log(ctx)
|
|
||||||
},
|
|
||||||
[flowBolsos2]
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Declarando flujo principal
|
|
||||||
*/
|
|
||||||
|
|
||||||
const flowPrincipal = addKeyword(['hola', 'ole', 'alo'])
|
const flowPrincipal = addKeyword(['hola', 'ole', 'alo'])
|
||||||
.addAnswer(['Hola, bienvenido a mi tienda', '¿Como puedo ayudarte?'])
|
.addAnswer('🙌 Hola bienvenido a este *Chatbot*')
|
||||||
.addAnswer(['Tengo:', 'Zapatos', 'Bolsos', 'etc ...'])
|
|
||||||
.addAnswer(
|
.addAnswer(
|
||||||
['Para continuar escribe:', '*(1) Zapatos*', '*(2) Bolsos*'],
|
[
|
||||||
{ capture: true },
|
'te comparto los siguientes links de interes sobre el proyecto',
|
||||||
(ctx) => {
|
'👉 *doc* para ver la documentación',
|
||||||
console.log('Aqui puedes ver más info del usuario...')
|
'👉 *gracias* para ver la lista de videos',
|
||||||
console.log('Puedes enviar un mail, hook, etc..')
|
'👉 *discord* unirte al discord',
|
||||||
console.log(ctx)
|
],
|
||||||
},
|
null,
|
||||||
[flowBolsos, flowZapatos]
|
null,
|
||||||
|
[flowDocs, flowGracias, flowTuto, flowDiscord]
|
||||||
)
|
)
|
||||||
|
|
||||||
const main = async () => {
|
const main = async () => {
|
||||||
const adapterDB = new JsonFileAdapter()
|
const adapterDB = new JsonFileAdapter()
|
||||||
const adapterFlow = createFlow([flowPrincipal])
|
const adapterFlow = createFlow([flowPrincipal])
|
||||||
const adapterProvider = createProvider(BaileysProvider)
|
const adapterProvider = createProvider(BaileysProvider)
|
||||||
|
|
||||||
createBot({
|
createBot({
|
||||||
flow: adapterFlow,
|
flow: adapterFlow,
|
||||||
provider: adapterProvider,
|
provider: adapterProvider,
|
||||||
database: adapterDB,
|
database: adapterDB,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
QRPortalWeb()
|
||||||
}
|
}
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-bailey-json",
|
"name": "base-bailey-json",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
"@bot-whatsapp/cli": "latest",
|
"@bot-whatsapp/cli": "latest",
|
||||||
"@bot-whatsapp/database": "latest",
|
"@bot-whatsapp/database": "latest",
|
||||||
"@bot-whatsapp/provider": "latest",
|
"@bot-whatsapp/provider": "latest",
|
||||||
|
"@bot-whatsapp/portal": "latest",
|
||||||
"@adiwajshing/baileys": "4.4.0",
|
"@adiwajshing/baileys": "4.4.0",
|
||||||
"mime-types": "2.1.35",
|
"mime-types": "2.1.35",
|
||||||
"wa-sticker-formatter": "4.3.2"
|
"wa-sticker-formatter": "4.3.2"
|
||||||
|
|||||||
@@ -1,80 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="es">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<link rel="preconnect" href="https://rsms.me/" />
|
|
||||||
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
|
|
||||||
<title>🤖 Crear chatbot WhatsApp en minutos</title>
|
|
||||||
<style>
|
|
||||||
html,
|
|
||||||
body {
|
|
||||||
display: flex;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
justify-content: center;
|
|
||||||
align-self: center;
|
|
||||||
align-items: center;
|
|
||||||
font-family: 'Inter', sans-serif;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div
|
|
||||||
style="
|
|
||||||
display: flex;
|
|
||||||
gap: 2rem;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
style="
|
|
||||||
box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px,
|
|
||||||
rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
|
|
||||||
border-radius: 15px;
|
|
||||||
object-fit: contain;
|
|
||||||
"
|
|
||||||
width="400"
|
|
||||||
height="400"
|
|
||||||
src="qr.png"
|
|
||||||
alt="Escanear QR"
|
|
||||||
/>
|
|
||||||
<div style="width: 400px; display: grid; gap: 1rem">
|
|
||||||
<h1 style="margin: 0">Whatsapp QR</h1>
|
|
||||||
<p>
|
|
||||||
<strong
|
|
||||||
>F5 para actualizar, el codigo se actualiza cada minuto. </strong
|
|
||||||
><br />
|
|
||||||
Con esta libreria, puedes configurar respuestas
|
|
||||||
automatizadas para preguntas frecuentes , recibir y
|
|
||||||
responder mensajes de manera automatizada, y hacer un
|
|
||||||
seguimiento de las interacciones con los clientes. Además,
|
|
||||||
nuestro Chatbot se integra fácilmente con otros sistemas y
|
|
||||||
herramientas que ya esté utilizando en su negocio.
|
|
||||||
</p>
|
|
||||||
<div>
|
|
||||||
<a
|
|
||||||
target="_blank"
|
|
||||||
style="
|
|
||||||
background: white;
|
|
||||||
box-shadow: rgb(0 0 0 / 16%) 0px 10px 36px 0px,
|
|
||||||
rgb(0 0 0 / 6%) 0px 0px 0px 1px;
|
|
||||||
padding: 10px;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-weight: 600;
|
|
||||||
text-decoration: none;
|
|
||||||
color: #1a1a1a;
|
|
||||||
border: solid 1px #afafaf;
|
|
||||||
"
|
|
||||||
href="https://bot-whatsapp.netlify.app/"
|
|
||||||
>Ver documentación</a
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
const http = require('http')
|
|
||||||
const fs = require('fs')
|
|
||||||
const path = require('path')
|
|
||||||
|
|
||||||
const PORT = process.env.PORT || 3000
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Levantar un HTTP Server
|
|
||||||
*/
|
|
||||||
http.createServer(function (req, res) {
|
|
||||||
var cssPath = undefined
|
|
||||||
var fileStream = undefined
|
|
||||||
var imagePath = undefined
|
|
||||||
|
|
||||||
if (req.url === '/') {
|
|
||||||
fs.readFile('./public/index.html', 'UTF-8', function (err, html) {
|
|
||||||
res.writeHead(200, { 'Content-Type': 'text/html' })
|
|
||||||
res.end(html)
|
|
||||||
})
|
|
||||||
} else if (req.url.match('.css$')) {
|
|
||||||
cssPath = path.join(__dirname, 'public', req.url)
|
|
||||||
fileStream = fs.createReadStream(cssPath, 'UTF-8')
|
|
||||||
res.writeHead(200, { 'Content-Type': 'text/css' })
|
|
||||||
fileStream.pipe(res)
|
|
||||||
} else if (req.url.match('.png$')) {
|
|
||||||
imagePath = path.join(__dirname, req.url)
|
|
||||||
fileStream = fs.createReadStream(imagePath)
|
|
||||||
res.writeHead(200, { 'Content-Type': 'image/png' })
|
|
||||||
fileStream.pipe(res)
|
|
||||||
} else {
|
|
||||||
res.writeHead(404, { 'Content-Type': 'text/html' })
|
|
||||||
res.end('No Page Found')
|
|
||||||
}
|
|
||||||
}).listen(PORT, () => console.log(`Escanear QR Code http://localhost:${PORT}`))
|
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
FROM node:lts-bullseye as bot
|
FROM node:18-bullseye as bot
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm i
|
RUN npm i
|
||||||
COPY . .
|
COPY . .
|
||||||
|
ARG RAILWAY_STATIC_URL
|
||||||
|
ARG PUBLIC_URL
|
||||||
ARG PORT
|
ARG PORT
|
||||||
CMD ["npm", "start"]
|
CMD ["npm", "start"]
|
||||||
|
|||||||
@@ -5,26 +5,8 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
**Con esta librería, puedes construir flujos automatizados de conversación de manera agnóstica al proveedor de WhatsApp,** configurar respuestas automatizadas para preguntas frecuentes, recibir y responder mensajes de manera automatizada, y hacer un seguimiento de las interacciones con los clientes. Además, puedes configurar fácilmente disparadores que te ayudaran a expandir las funcionalidades sin límites. **[Ver más informacion](https://bot-whatsapp.netlify.app/)**
|
**Con esta librería, puedes construir flujos automatizados de conversación de manera agnóstica al proveedor de WhatsApp,** configurar respuestas automatizadas para preguntas frecuentes, recibir y responder mensajes de manera automatizada, y hacer un seguimiento de las interacciones con los clientes. Además, puedes configurar fácilmente disparadores que te ayudaran a expandir las funcionalidades sin límites. **[Ver documentación](https://bot-whatsapp.netlify.app/)**
|
||||||
|
|
||||||
```js
|
|
||||||
const main = async () => {
|
|
||||||
const adapterDB = new MockAdapter()
|
|
||||||
const adapterFlow = createFlow([flowPrincipal])
|
|
||||||
|
|
||||||
const adapterProvider = createProvider(BaileysProvider, {
|
|
||||||
accountSid: process.env.ACC_SID,
|
|
||||||
authToken: process.env.ACC_TOKEN,
|
|
||||||
vendorNumber: process.env.ACC_VENDOR,
|
|
||||||
})
|
|
||||||
|
|
||||||
createBot({
|
|
||||||
flow: adapterFlow,
|
|
||||||
provider: adapterProvider,
|
|
||||||
database: adapterDB,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
```
|
||||||
npm install
|
npm install
|
||||||
|
|||||||
@@ -5,86 +5,62 @@ const {
|
|||||||
addKeyword,
|
addKeyword,
|
||||||
} = require('@bot-whatsapp/bot')
|
} = require('@bot-whatsapp/bot')
|
||||||
|
|
||||||
require('./server.http')
|
const QRPortalWeb = require('@bot-whatsapp/portal')
|
||||||
|
|
||||||
const BaileysProvider = require('@bot-whatsapp/provider/baileys')
|
const BaileysProvider = require('@bot-whatsapp/provider/baileys')
|
||||||
const MockAdapter = require('@bot-whatsapp/database/mock')
|
const MockAdapter = require('@bot-whatsapp/database/mock')
|
||||||
|
|
||||||
/**
|
const flowDocs = addKeyword([
|
||||||
* Aqui declaramos los flujos hijos, los flujos se declaran de atras para adelante, es decir que si tienes un flujo de este tipo:
|
'doc',
|
||||||
*
|
'documentacion',
|
||||||
* Menu Principal
|
'documentación',
|
||||||
* - SubMenu 1
|
]).addAnswer([
|
||||||
* - Submenu 1.1
|
'📄 Aquí encontras las documentación recuerda que puedes mejorarla',
|
||||||
* - Submenu 2
|
'https://bot-whatsapp.netlify.app/',
|
||||||
* - Submenu 2.1
|
])
|
||||||
*
|
|
||||||
* Primero declaras los submenus 1.1 y 2.1, luego el 1 y 2 y al final el principal.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const flowBolsos2 = addKeyword(['bolsos2', '2'])
|
const flowTuto = addKeyword(['tutorial', 'tuto']).addAnswer([
|
||||||
.addAnswer('🤯 *MUCHOS* bolsos ...')
|
'🙌 Aquí encontras un ejemplo rapido',
|
||||||
.addAnswer('y mas bolsos... bla bla')
|
'https://bot-whatsapp.netlify.app/docs/example/',
|
||||||
|
])
|
||||||
|
|
||||||
const flowZapatos2 = addKeyword(['zapatos2', '2'])
|
const flowGracias = addKeyword(['gracias', 'grac']).addAnswer([
|
||||||
.addAnswer('🤯 repito que tengo *MUCHOS* zapatos.')
|
'🚀 Puedes aportar tu granito de arena a este proyecto',
|
||||||
.addAnswer('y algunas otras cosas.')
|
'[*opencollective*] https://opencollective.com/bot-whatsapp',
|
||||||
|
'[*buymeacoffee*] https://www.buymeacoffee.com/leifermendez',
|
||||||
|
'[*patreon*] https://www.patreon.com/leifermendez',
|
||||||
|
])
|
||||||
|
|
||||||
const flowZapatos = addKeyword(['1', 'zapatos', 'ZAPATOS'])
|
const flowDiscord = addKeyword(['discord']).addAnswer([
|
||||||
.addAnswer('🤯 Veo que elegiste zapatos')
|
'🤪 Únete al discord',
|
||||||
.addAnswer('Tengo muchos zapatos...bla bla')
|
'https://link.codigoencasa.com/DISCORD',
|
||||||
.addAnswer(
|
])
|
||||||
['Manda:', '*(2) Zapatos2*', 'para mas información'],
|
|
||||||
{ capture: true },
|
|
||||||
(ctx) => {
|
|
||||||
console.log('Aqui puedes ver más info del usuario...')
|
|
||||||
console.log('Puedes enviar un mail, hook, etc..')
|
|
||||||
console.log(ctx)
|
|
||||||
},
|
|
||||||
[flowZapatos2]
|
|
||||||
)
|
|
||||||
|
|
||||||
const flowBolsos = addKeyword(['2', 'bolsos', 'BOLSOS'])
|
|
||||||
.addAnswer('🙌 Veo que elegiste bolsos')
|
|
||||||
.addAnswer('Tengo muchos bolsos...bla bla')
|
|
||||||
.addAnswer(
|
|
||||||
['Manda:', '*(2) Bolsos2*', 'para mas información.'],
|
|
||||||
{ capture: true },
|
|
||||||
(ctx) => {
|
|
||||||
console.log('Aqui puedes ver más info del usuario...')
|
|
||||||
console.log('Puedes enviar un mail, hook, etc..')
|
|
||||||
console.log(ctx)
|
|
||||||
},
|
|
||||||
[flowBolsos2]
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Declarando flujo principal
|
|
||||||
*/
|
|
||||||
|
|
||||||
const flowPrincipal = addKeyword(['hola', 'ole', 'alo'])
|
const flowPrincipal = addKeyword(['hola', 'ole', 'alo'])
|
||||||
.addAnswer(['Hola, bienvenido a mi tienda', '¿Como puedo ayudarte?'])
|
.addAnswer('🙌 Hola bienvenido a este *Chatbot*')
|
||||||
.addAnswer(['Tengo:', 'Zapatos', 'Bolsos', 'etc ...'])
|
|
||||||
.addAnswer(
|
.addAnswer(
|
||||||
['Para continuar escribe:', '*(1) Zapatos*', '*(2) Bolsos*'],
|
[
|
||||||
{ capture: true },
|
'te comparto los siguientes links de interes sobre el proyecto',
|
||||||
(ctx) => {
|
'👉 *doc* para ver la documentación',
|
||||||
console.log('Aqui puedes ver más info del usuario...')
|
'👉 *gracias* para ver la lista de videos',
|
||||||
console.log('Puedes enviar un mail, hook, etc..')
|
'👉 *discord* unirte al discord',
|
||||||
console.log(ctx)
|
],
|
||||||
},
|
null,
|
||||||
[flowBolsos, flowZapatos]
|
null,
|
||||||
|
[flowDocs, flowGracias, flowTuto, flowDiscord]
|
||||||
)
|
)
|
||||||
|
|
||||||
const main = async () => {
|
const main = async () => {
|
||||||
const adapterDB = new MockAdapter()
|
const adapterDB = new MockAdapter()
|
||||||
const adapterFlow = createFlow([flowPrincipal])
|
const adapterFlow = createFlow([flowPrincipal])
|
||||||
const adapterProvider = createProvider(BaileysProvider)
|
const adapterProvider = createProvider(BaileysProvider)
|
||||||
|
|
||||||
createBot({
|
createBot({
|
||||||
flow: adapterFlow,
|
flow: adapterFlow,
|
||||||
provider: adapterProvider,
|
provider: adapterProvider,
|
||||||
database: adapterDB,
|
database: adapterDB,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
QRPortalWeb()
|
||||||
}
|
}
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-bailey-memory",
|
"name": "base-bailey-memory",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
"@bot-whatsapp/cli": "latest",
|
"@bot-whatsapp/cli": "latest",
|
||||||
"@bot-whatsapp/database": "latest",
|
"@bot-whatsapp/database": "latest",
|
||||||
"@bot-whatsapp/provider": "latest",
|
"@bot-whatsapp/provider": "latest",
|
||||||
|
"@bot-whatsapp/portal": "latest",
|
||||||
"@adiwajshing/baileys": "4.4.0",
|
"@adiwajshing/baileys": "4.4.0",
|
||||||
"mime-types": "2.1.35",
|
"mime-types": "2.1.35",
|
||||||
"wa-sticker-formatter": "4.3.2"
|
"wa-sticker-formatter": "4.3.2"
|
||||||
|
|||||||
@@ -1,80 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="es">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<link rel="preconnect" href="https://rsms.me/" />
|
|
||||||
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
|
|
||||||
<title>🤖 Crear chatbot WhatsApp en minutos</title>
|
|
||||||
<style>
|
|
||||||
html,
|
|
||||||
body {
|
|
||||||
display: flex;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
justify-content: center;
|
|
||||||
align-self: center;
|
|
||||||
align-items: center;
|
|
||||||
font-family: 'Inter', sans-serif;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div
|
|
||||||
style="
|
|
||||||
display: flex;
|
|
||||||
gap: 2rem;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
style="
|
|
||||||
box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px,
|
|
||||||
rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
|
|
||||||
border-radius: 15px;
|
|
||||||
object-fit: contain;
|
|
||||||
"
|
|
||||||
width="400"
|
|
||||||
height="400"
|
|
||||||
src="qr.png"
|
|
||||||
alt="Escanear QR"
|
|
||||||
/>
|
|
||||||
<div style="width: 400px; display: grid; gap: 1rem">
|
|
||||||
<h1 style="margin: 0">Whatsapp QR</h1>
|
|
||||||
<p>
|
|
||||||
<strong
|
|
||||||
>F5 para actualizar, el codigo se actualiza cada minuto. </strong
|
|
||||||
><br />
|
|
||||||
Con esta libreria, puedes configurar respuestas
|
|
||||||
automatizadas para preguntas frecuentes , recibir y
|
|
||||||
responder mensajes de manera automatizada, y hacer un
|
|
||||||
seguimiento de las interacciones con los clientes. Además,
|
|
||||||
nuestro Chatbot se integra fácilmente con otros sistemas y
|
|
||||||
herramientas que ya esté utilizando en su negocio.
|
|
||||||
</p>
|
|
||||||
<div>
|
|
||||||
<a
|
|
||||||
target="_blank"
|
|
||||||
style="
|
|
||||||
background: white;
|
|
||||||
box-shadow: rgb(0 0 0 / 16%) 0px 10px 36px 0px,
|
|
||||||
rgb(0 0 0 / 6%) 0px 0px 0px 1px;
|
|
||||||
padding: 10px;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-weight: 600;
|
|
||||||
text-decoration: none;
|
|
||||||
color: #1a1a1a;
|
|
||||||
border: solid 1px #afafaf;
|
|
||||||
"
|
|
||||||
href="https://bot-whatsapp.netlify.app/"
|
|
||||||
>Ver documentación</a
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
const http = require('http')
|
|
||||||
const fs = require('fs')
|
|
||||||
const path = require('path')
|
|
||||||
|
|
||||||
const PORT = process.env.PORT || 3000
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Levantar un HTTP Server
|
|
||||||
*/
|
|
||||||
http.createServer(function (req, res) {
|
|
||||||
var cssPath = undefined
|
|
||||||
var fileStream = undefined
|
|
||||||
var imagePath = undefined
|
|
||||||
|
|
||||||
if (req.url === '/') {
|
|
||||||
fs.readFile('./public/index.html', 'UTF-8', function (err, html) {
|
|
||||||
res.writeHead(200, { 'Content-Type': 'text/html' })
|
|
||||||
res.end(html)
|
|
||||||
})
|
|
||||||
} else if (req.url.match('.css$')) {
|
|
||||||
cssPath = path.join(__dirname, 'public', req.url)
|
|
||||||
fileStream = fs.createReadStream(cssPath, 'UTF-8')
|
|
||||||
res.writeHead(200, { 'Content-Type': 'text/css' })
|
|
||||||
fileStream.pipe(res)
|
|
||||||
} else if (req.url.match('.png$')) {
|
|
||||||
imagePath = path.join(__dirname, req.url)
|
|
||||||
fileStream = fs.createReadStream(imagePath)
|
|
||||||
res.writeHead(200, { 'Content-Type': 'image/png' })
|
|
||||||
fileStream.pipe(res)
|
|
||||||
} else {
|
|
||||||
res.writeHead(404, { 'Content-Type': 'text/html' })
|
|
||||||
res.end('No Page Found')
|
|
||||||
}
|
|
||||||
}).listen(PORT, () => console.log(`Escanear QR Code http://localhost:${PORT}`))
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-bailey-mongo",
|
"name": "base-bailey-mongo",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,80 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="es">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<link rel="preconnect" href="https://rsms.me/" />
|
|
||||||
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
|
|
||||||
<title>🤖 Crear chatbot WhatsApp en minutos</title>
|
|
||||||
<style>
|
|
||||||
html,
|
|
||||||
body {
|
|
||||||
display: flex;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
justify-content: center;
|
|
||||||
align-self: center;
|
|
||||||
align-items: center;
|
|
||||||
font-family: 'Inter', sans-serif;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div
|
|
||||||
style="
|
|
||||||
display: flex;
|
|
||||||
gap: 2rem;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
style="
|
|
||||||
box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px,
|
|
||||||
rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
|
|
||||||
border-radius: 15px;
|
|
||||||
object-fit: contain;
|
|
||||||
"
|
|
||||||
width="400"
|
|
||||||
height="400"
|
|
||||||
src="qr.png"
|
|
||||||
alt="Escanear QR"
|
|
||||||
/>
|
|
||||||
<div style="width: 400px; display: grid; gap: 1rem">
|
|
||||||
<h1 style="margin: 0">Whatsapp QR</h1>
|
|
||||||
<p>
|
|
||||||
<strong
|
|
||||||
>F5 para actualizar, el codigo se actualiza cada minuto. </strong
|
|
||||||
><br />
|
|
||||||
Con esta libreria, puedes configurar respuestas
|
|
||||||
automatizadas para preguntas frecuentes , recibir y
|
|
||||||
responder mensajes de manera automatizada, y hacer un
|
|
||||||
seguimiento de las interacciones con los clientes. Además,
|
|
||||||
nuestro Chatbot se integra fácilmente con otros sistemas y
|
|
||||||
herramientas que ya esté utilizando en su negocio.
|
|
||||||
</p>
|
|
||||||
<div>
|
|
||||||
<a
|
|
||||||
target="_blank"
|
|
||||||
style="
|
|
||||||
background: white;
|
|
||||||
box-shadow: rgb(0 0 0 / 16%) 0px 10px 36px 0px,
|
|
||||||
rgb(0 0 0 / 6%) 0px 0px 0px 1px;
|
|
||||||
padding: 10px;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-weight: 600;
|
|
||||||
text-decoration: none;
|
|
||||||
color: #1a1a1a;
|
|
||||||
border: solid 1px #afafaf;
|
|
||||||
"
|
|
||||||
href="https://bot-whatsapp.netlify.app/"
|
|
||||||
>Ver documentación</a
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
const http = require('http')
|
|
||||||
const fs = require('fs')
|
|
||||||
const path = require('path')
|
|
||||||
|
|
||||||
const PORT = process.env.PORT || 3000
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Levantar un HTTP Server
|
|
||||||
*/
|
|
||||||
http.createServer(function (req, res) {
|
|
||||||
var cssPath = undefined
|
|
||||||
var fileStream = undefined
|
|
||||||
var imagePath = undefined
|
|
||||||
|
|
||||||
if (req.url === '/') {
|
|
||||||
fs.readFile('./public/index.html', 'UTF-8', function (err, html) {
|
|
||||||
res.writeHead(200, { 'Content-Type': 'text/html' })
|
|
||||||
res.end(html)
|
|
||||||
})
|
|
||||||
} else if (req.url.match('.css$')) {
|
|
||||||
cssPath = path.join(__dirname, 'public', req.url)
|
|
||||||
fileStream = fs.createReadStream(cssPath, 'UTF-8')
|
|
||||||
res.writeHead(200, { 'Content-Type': 'text/css' })
|
|
||||||
fileStream.pipe(res)
|
|
||||||
} else if (req.url.match('.png$')) {
|
|
||||||
imagePath = path.join(__dirname, req.url)
|
|
||||||
fileStream = fs.createReadStream(imagePath)
|
|
||||||
res.writeHead(200, { 'Content-Type': 'image/png' })
|
|
||||||
fileStream.pipe(res)
|
|
||||||
} else {
|
|
||||||
res.writeHead(404, { 'Content-Type': 'text/html' })
|
|
||||||
res.end('No Page Found')
|
|
||||||
}
|
|
||||||
}).listen(PORT, () => console.log(`Escanear QR Code http://localhost:${PORT}`))
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-bailey-mysql",
|
"name": "base-bailey-mysql",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-meta-json",
|
"name": "base-meta-json",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-meta-memory",
|
"name": "base-meta-memory",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-meta-mongo",
|
"name": "base-meta-mongo",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-meta-mysql",
|
"name": "base-meta-mysql",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-twilio-json",
|
"name": "base-twilio-json",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-twilio-memory",
|
"name": "base-twilio-memory",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-twilio-mongo",
|
"name": "base-twilio-mongo",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-twilio-mysql",
|
"name": "base-twilio-mysql",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-venom-json",
|
"name": "base-venom-json",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-venom-memory",
|
"name": "base-venom-memory",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-venom-mongo",
|
"name": "base-venom-mongo",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-venom-mysql",
|
"name": "base-venom-mysql",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-wweb-json",
|
"name": "base-wweb-json",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-wweb-memory",
|
"name": "base-wweb-memory",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-wweb-mongo",
|
"name": "base-wweb-mongo",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "bot-whatsapp-base-wweb-mysql",
|
"name": "base-wweb-mysql",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user