-
Notifications
You must be signed in to change notification settings - Fork 48
/
app.js
45 lines (37 loc) · 1.03 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
require("dotenv").config();
const { createBot, createProvider, createFlow } = require("@bot-whatsapp/bot");
const QRPortalWeb = require("@bot-whatsapp/portal");
const BaileysProvider = require("@bot-whatsapp/provider/baileys");
const MockAdapter = require("@bot-whatsapp/database/mock");
/**
* ChatGPT
*/
const ChatGPTClass = require("./chatgpt.class");
const chatGPT = new ChatGPTClass();
/**
* Flows
*/
const flowPrincipal = require("./flows/flowPrincipal");
const flowAgente = require("./flows/flowAgente");
const { flowReparacion } = require("./flows/flowReparacion");
const { flowOfertas } = require("./flows/flowOfertas");
/**
* Funcion principal
*/
const main = async () => {
const adapterDB = new MockAdapter();
const adapterFlow = createFlow([
flowPrincipal,
flowAgente,
flowReparacion(chatGPT),
flowOfertas(chatGPT),
]);
const adapterProvider = createProvider(BaileysProvider);
createBot({
flow: adapterFlow,
provider: adapterProvider,
database: adapterDB,
});
QRPortalWeb();
};
main();