tgbot-cpp
Toggle main menu visibility
Loading...
Searching...
No Matches
Bot.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
tgbot/Api.h
"
4
#include "
tgbot/EventHandler.h
"
5
#include "
tgbot/export.h
"
6
7
#include <memory>
8
#include <string>
9
10
namespace
TgBot
{
11
12
class
EventBroadcaster
;
13
class
HttpClient
;
14
20
class
TGBOT_API
Bot
{
21
public
:
22
explicit
Bot
(std::string token,
const
HttpClient
& httpClient = _getDefaultHttpClient(),
23
const
std::string& url =
"https://api.telegram.org"
);
24
28
const
std::string&
getToken
()
const
{
29
return
_token;
30
}
31
35
const
Api
&
getApi
()
const
{
36
return
_api;
37
}
38
42
EventBroadcaster
&
getEvents
() {
43
return
*_eventBroadcaster;
44
}
45
49
const
EventHandler
&
getEventHandler
()
const
{
50
return
_eventHandler;
51
}
52
53
private
:
54
static
HttpClient
& _getDefaultHttpClient();
55
56
const
std::string _token;
57
const
Api
_api;
58
std::unique_ptr<EventBroadcaster> _eventBroadcaster;
59
const
EventHandler
_eventHandler;
60
};
61
62
}
// namespace TgBot
Api.h
EventHandler.h
TgBot::Api
Executes methods from the Telegram Bot API.
Definition
Api.h:30
TgBot::Bot::getApi
const Api & getApi() const
Definition
Bot.h:35
TgBot::Bot::getEvents
EventBroadcaster & getEvents()
Definition
Bot.h:42
TgBot::Bot::getToken
const std::string & getToken() const
Definition
Bot.h:28
TgBot::Bot::Bot
Bot(std::string token, const HttpClient &httpClient=_getDefaultHttpClient(), const std::string &url="https://api.telegram.org")
TgBot::Bot::getEventHandler
const EventHandler & getEventHandler() const
Definition
Bot.h:49
TgBot::EventBroadcaster
This class holds all event listeners.
Definition
EventBroadcaster.h:21
TgBot::EventHandler
Definition
EventHandler.h:12
TgBot::HttpClient
This class makes http requests.
Definition
HttpClient.h:18
export.h
TGBOT_API
#define TGBOT_API
Definition
export.h:5
TgBot
Definition
Api.h:17
include
tgbot
Bot.h
Generated on
for tgbot-cpp by
1.17.0