-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
48 lines (35 loc) · 2.74 KB
/
index.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
46
47
48
console.log(`/*-------------------------------------------------------------------------------------------*/`);
console.log(`/* Илья Михальчик */`);
console.log(`/*-------------------------------------------------------------------------------------------*/`);
console.log(`/* */`);
console.log(`/* Бот-визитка */`);
console.log(`/* */`);
console.log(`/*-------------------------------------------------------------------------------------------*/`);
process.env.TZ = "Europe/Moscow";
const config = require("./config.json");
const { VK } = require('vk-io');
const vk = new VK({
token: config.access_token.group,
lang: "ru",
pollingGroupId: config.id.group,
apiMode: "parallel"
});
const { updates } = vk;
console.log("[System] Бот начинает загружать клиентский функционал!");
updates.startPolling();
/*----------------------------------------------------------------------------------------------------------*/
/* Файлы Евентов */
/*----------------------------------------------------------------------------------------------------------*/
const messageEvent = require("./events/message")
/*----------------------------------------------------------------------------------------------------------*/
/* Евенты */
/*----------------------------------------------------------------------------------------------------------*/
updates.on('message', messageEvent)
/*----------------------------------------------------------------------------------------------------------*/
/* Файлы команд */
/*----------------------------------------------------------------------------------------------------------*/
const infoCommand = require("./commands/info")
/*----------------------------------------------------------------------------------------------------------*/
/* Команды */
/*----------------------------------------------------------------------------------------------------------*/
updates.hear(/^(?:info|инфо|начать)/ig, infoCommand)