-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunner.cpp
More file actions
33 lines (27 loc) · 799 Bytes
/
Runner.cpp
File metadata and controls
33 lines (27 loc) · 799 Bytes
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
/*
Copyright (c) 2018 by Ilya Barykin
Released under the MIT License.
See the provided LICENSE.TXT file for details.
*/
#include "Runner.h"
#include <QDebug>
#include <tasks/vk/PostsVkTask.h>
#include <apis/bots/TelegramBot.h>
#include <apis/handlers/VkHandler.h>
#include <apis/handlers/TelegramHandler.h>
Runner::Runner() {
storage = Storage::instance();
storage->load();
manager = new QueueManager;
tasks_manager = new TaskManager(this);
}
void Runner::start() {
api_telegram = new TelegramApi;
handlers = {new VkHandler(VK_TOKEN), new TelegramHandler(api_telegram)};
manager->addHandlers(handlers);
bots = {{"Telegram", new TelegramBot(this, api_telegram)}};
for (Bot *bot : bots.values()) {
bot->start();
}
tasks_manager->start();
}