forked from codigoencasa/bot-whatsapp
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(provider): ⚡ added tamplate venom
- Loading branch information
1 parent
01fe9eb
commit 337c2e9
Showing
9 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
### BASE APP | ||
|
||
Este bot contiene un flujo basico en el cual una persona (cliente) escribe **"hola"** y el bot responde. | ||
- Bienvenido a mi tienda | ||
- Como puedo ayudarte? | ||
- Tengo: Zapatos Bolsos etc.. | ||
|
||
------ | ||
- [Discord](https://link.codigoencasa.com/DISCORD) | ||
- [Twitter](https://twitter.com/leifermendez) | ||
- [Youtube](https://www.youtube.com/watch?v=5lEMCeWEJ8o&list=PL_WGMLcL4jzWPhdhcUyhbFU6bC0oJd2BR) | ||
- [Telegram](https://t.me/leifermendez) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const { | ||
createBot, | ||
createProvider, | ||
createFlow, | ||
addKeyword, | ||
} = require('@bot-whatsapp/bot') | ||
|
||
const WebWhatsappProvider = require('@bot-whatsapp/provider/venom') | ||
const MockAdapter = require('@bot-whatsapp/database/mock') | ||
|
||
const flowPrincipal = addKeyword(['hola', 'ole', 'HOLA']) | ||
.addAnswer('Bienvenido a mi tienda') | ||
.addAnswer('Como puedo ayudarte?') | ||
.addAnswer(['Tengo:', 'Zapatos', 'Bolsos', 'etc..']) | ||
|
||
const main = async () => { | ||
const adapterDB = new MockAdapter() | ||
const adapterFlow = createFlow([flowPrincipal]) | ||
const adapterProvider = createProvider(WebWhatsappProvider) | ||
|
||
createBot({ | ||
flow: adapterFlow, | ||
provider: adapterProvider, | ||
database: adapterDB, | ||
}) | ||
} | ||
|
||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "bot-whatsapp-base", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "app.js", | ||
"scripts": { | ||
"pre-copy": "cd .. && yarn run copy.lib base-venom-mysql", | ||
"start": "node app.js" | ||
}, | ||
"keywords": [], | ||
"dependencies": { | ||
"venom-bot": "^4.3.7", | ||
"@bot-whatsapp/bot": "latest", | ||
"@bot-whatsapp/cli": "latest", | ||
"@bot-whatsapp/database": "latest", | ||
"@bot-whatsapp/provider": "latest" | ||
}, | ||
"author": "", | ||
"license": "ISC" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
### BASE APP | ||
|
||
Este bot contiene un flujo basico en el cual una persona (cliente) escribe **"hola"** y el bot responde. | ||
- Bienvenido a mi tienda | ||
- Como puedo ayudarte? | ||
- Tengo: Zapatos Bolsos etc.. | ||
|
||
------ | ||
- [Discord](https://link.codigoencasa.com/DISCORD) | ||
- [Twitter](https://twitter.com/leifermendez) | ||
- [Youtube](https://www.youtube.com/watch?v=5lEMCeWEJ8o&list=PL_WGMLcL4jzWPhdhcUyhbFU6bC0oJd2BR) | ||
- [Telegram](https://t.me/leifermendez) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const { | ||
createBot, | ||
createProvider, | ||
createFlow, | ||
addKeyword, | ||
} = require('@bot-whatsapp/bot') | ||
|
||
const WebWhatsappProvider = require('@bot-whatsapp/provider/venom') | ||
const MockAdapter = require('@bot-whatsapp/database/mock') | ||
|
||
const flowPrincipal = addKeyword(['hola', 'ole', 'HOLA']) | ||
.addAnswer('Bienvenido a mi tienda') | ||
.addAnswer('Como puedo ayudarte?') | ||
.addAnswer(['Tengo:', 'Zapatos', 'Bolsos', 'etc..']) | ||
|
||
const main = async () => { | ||
const adapterDB = new MockAdapter() | ||
const adapterFlow = createFlow([flowPrincipal]) | ||
const adapterProvider = createProvider(WebWhatsappProvider) | ||
|
||
createBot({ | ||
flow: adapterFlow, | ||
provider: adapterProvider, | ||
database: adapterDB, | ||
}) | ||
} | ||
|
||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "bot-whatsapp-base", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "app.js", | ||
"scripts": { | ||
"pre-copy": "cd .. && yarn run copy.lib base-venom-mysql", | ||
"start": "node app.js" | ||
}, | ||
"keywords": [], | ||
"dependencies": { | ||
"venom-bot": "^4.3.7", | ||
"@bot-whatsapp/bot": "latest", | ||
"@bot-whatsapp/cli": "latest", | ||
"@bot-whatsapp/database": "latest", | ||
"@bot-whatsapp/provider": "latest" | ||
}, | ||
"author": "", | ||
"license": "ISC" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
### BASE APP | ||
|
||
Este bot contiene un flujo basico en el cual una persona (cliente) escribe **"hola"** y el bot responde. | ||
- Bienvenido a mi tienda | ||
- Como puedo ayudarte? | ||
- Tengo: Zapatos Bolsos etc.. | ||
|
||
------ | ||
- [Discord](https://link.codigoencasa.com/DISCORD) | ||
- [Twitter](https://twitter.com/leifermendez) | ||
- [Youtube](https://www.youtube.com/watch?v=5lEMCeWEJ8o&list=PL_WGMLcL4jzWPhdhcUyhbFU6bC0oJd2BR) | ||
- [Telegram](https://t.me/leifermendez) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const { | ||
createBot, | ||
createProvider, | ||
createFlow, | ||
addKeyword, | ||
} = require('@bot-whatsapp/bot') | ||
|
||
const WebWhatsappProvider = require('@bot-whatsapp/provider/venom') | ||
const MockAdapter = require('@bot-whatsapp/database/mock') | ||
|
||
const flowPrincipal = addKeyword(['hola', 'ole', 'HOLA']) | ||
.addAnswer('Bienvenido a mi tienda') | ||
.addAnswer('Como puedo ayudarte?') | ||
.addAnswer(['Tengo:', 'Zapatos', 'Bolsos', 'etc..']) | ||
|
||
const main = async () => { | ||
const adapterDB = new MockAdapter() | ||
const adapterFlow = createFlow([flowPrincipal]) | ||
const adapterProvider = createProvider(WebWhatsappProvider) | ||
|
||
createBot({ | ||
flow: adapterFlow, | ||
provider: adapterProvider, | ||
database: adapterDB, | ||
}) | ||
} | ||
|
||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "bot-whatsapp-base", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "app.js", | ||
"scripts": { | ||
"pre-copy": "cd .. && yarn run copy.lib base-venom-mysql", | ||
"start": "node app.js" | ||
}, | ||
"keywords": [], | ||
"dependencies": { | ||
"venom-bot": "^4.3.7", | ||
"@bot-whatsapp/bot": "latest", | ||
"@bot-whatsapp/cli": "latest", | ||
"@bot-whatsapp/database": "latest", | ||
"@bot-whatsapp/provider": "latest" | ||
}, | ||
"author": "", | ||
"license": "ISC" | ||
} |