summaryrefslogtreecommitdiff
path: root/src/Bot.cpp
blob: af3602934d84d9c501e97401dc6fadac10b5ca04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "tgbot/net/BoostHttpOnlySslClient.h"
#include "tgbot/net/CurlHttpClient.h"
#include "tgbot/Bot.h"

#include "tgbot/EventBroadcaster.h"

#include <memory>
#include <string>

namespace TgBot {

Bot::Bot(std::string token, const std::string& url, const HttpClient& httpClient)
    : _token(std::move(token))
    , _api(_token, httpClient, url)
    , _eventBroadcaster(std::make_unique<EventBroadcaster>())
    , _eventHandler(getEvents()) {
}

HttpClient& Bot::_getDefaultHttpClient() {
    static CurlHttpClient instance;
    return instance;
}

}