-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.ts
45 lines (41 loc) · 1.38 KB
/
index.ts
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
import config from './config/default.json';
import express from 'express';
import { create } from 'venom-bot';
import { catchQR, statusFind, start } from './venom/route';
import { routeBuilder } from './express/route';
import { defaultOptions, CreateConfig } from 'venom-bot/dist/config/create-config';
import { puppeteerConfig } from 'venom-bot/dist/config/puppeteer.config';
const app = express();
const PORT = config.api.port;
app.use(express.json());
app.use(express.urlencoded());
create(config.sessionName, catchQR, statusFind,<CreateConfig>{
folderNameToken: 'tokens',
mkdirFolderToken: '',
headless: true, //Default: true
devtools: false,
useChrome: true,
debug: false,
logQR: true,
browserWS: '',
browserArgs: puppeteerConfig.chromiumArgs,
puppeteerOptions: {},
disableSpins: true, //Default: false
disableWelcome: true, //Default: false
updatesLog: true,
autoClose: 120000,
createPathFileToken: true,
waitForLogin: false, //Default: true
})
.then((client) => {
console.log("@@@@@@@@@@@@@@@@@@@@@@VENOM.THEN@@@@@@@@@@@@@@@@@");
start(client);
app.use("/"+config.sessionName,routeBuilder(client));
})
.catch((erro) => {
console.log(erro);
});
app.get('/', (req, res) => res.send('Express + TypeScript Server'));
app.listen(PORT, () => {
console.log(`⚡️[server]: Server is running at http://localhost:${PORT}`);
});