mirror of
https://github.com/muerwre/vk-tg-bot.git
synced 2025-04-25 23:16:41 +07:00
#4 added simple DB layer
This commit is contained in:
parent
f3a746efe8
commit
c0588acd26
15 changed files with 476 additions and 11 deletions
|
@ -4,12 +4,17 @@ import logger from "./service/logger";
|
|||
import { VkService } from "./service/vk";
|
||||
import { TelegramApi } from "./api/telegram";
|
||||
import { HttpApi } from "./api/http";
|
||||
import { PostgresDB } from "./service/db/postgres";
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
const config = prepareConfig();
|
||||
|
||||
const db = new PostgresDB(config.postgres);
|
||||
await db.connect();
|
||||
|
||||
const telegram = new TelegramService(config.telegram);
|
||||
const vkService = new VkService(config.vk, telegram, config.templates);
|
||||
const vkService = new VkService(config.vk, telegram, config.templates, db);
|
||||
|
||||
const telegramApi = new TelegramApi(telegram).listen();
|
||||
await telegram.start();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue