Skip to content

Commit 690a9b8

Browse files
committed
Переименовано в MaxBot
1 parent e79ac64 commit 690a9b8

293 files changed

Lines changed: 2171 additions & 2171 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docker-image.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v2
1616
- name: Build docker image
17-
run: docker build -t reo7sp/tgbot-cpp -f Dockerfile .
17+
run: docker build -t reo7sp/maxbot-cpp -f Dockerfile .
1818
- name: Build docker image with examples and unit tests
19-
run: docker build -t reo7sp/tgbot-cpp-test -f Dockerfile_test .
19+
run: docker build -t reo7sp/maxbot-cpp-test -f Dockerfile_test .
2020
- name: Run unit tests
21-
run: docker run --rm reo7sp/tgbot-cpp-test
21+
run: docker run --rm reo7sp/maxbot-cpp-test

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ install_manifest.txt
1111
.sw
1212
doc/
1313
Thumbs.db
14-
TgBot_test
14+
MaxBot_test
1515
.idea/
1616
docs/
1717
cmake-build-*

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
cmake_minimum_required(VERSION 3.10.2)
2-
project(TgBot)
2+
project(MaxBot)
33

44
if(POLICY CMP0074)
55
cmake_policy(SET CMP0074 NEW) # find_package() uses <PackageName>_ROOT variables
66
endif()
77

88
# options
99
option(ENABLE_TESTS "Set to ON to enable building of tests" OFF)
10-
option(BUILD_SHARED_LIBS "Build tgbot-cpp shared/static library." OFF)
10+
option(BUILD_SHARED_LIBS "Build maxbot-cpp shared/static library." OFF)
1111
option(BUILD_DOCUMENTATION "Build doxygen API documentation." OFF)
1212

1313
# sources
@@ -28,12 +28,12 @@ set(SRC_LIST
2828
src/Api.cpp
2929
src/Bot.cpp
3030
src/EventHandler.cpp
31-
src/TgException.cpp
32-
src/TgTypeParser.cpp
31+
src/BotException.cpp
32+
src/BotTypeParser.cpp
3333
src/net/BoostHttpOnlySslClient.cpp
3434
src/net/CurlHttpClient.cpp
3535
src/net/HttpParser.cpp
36-
src/net/TgLongPoll.cpp
36+
src/net/BotLongPoll.cpp
3737
src/net/Url.cpp
3838
src/tools/FileTools.cpp
3939
src/tools/StringTools.cpp

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ RUN apt-get -qq update && \
55
apt-get -qq install -y g++ make binutils cmake libssl-dev libboost-system-dev libcurl4-openssl-dev zlib1g-dev && \
66
rm -rf /var/lib/apt/lists/*
77

8-
WORKDIR /usr/src/tgbot-cpp
8+
WORKDIR /usr/src/maxbot-cpp
99
COPY include include
1010
COPY src src
1111
COPY CMakeLists.txt ./
1212

1313
RUN cmake . && \
1414
make -j$(nproc) && \
1515
make install && \
16-
rm -rf /usr/src/tgbot-cpp/*
16+
rm -rf /usr/src/maxbot-cpp/*

Dockerfile_test

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN apt-get -qq update && \
1919
zlib1g-dev && \
2020
rm -rf /var/lib/apt/lists/*
2121

22-
WORKDIR /usr/src/tgbot-cpp
22+
WORKDIR /usr/src/maxbot-cpp
2323
COPY include include
2424
COPY src src
2525
COPY test test
@@ -31,51 +31,51 @@ RUN cmake -DENABLE_TESTS=ON . && \
3131

3232
COPY samples samples
3333

34-
WORKDIR /usr/src/tgbot-cpp/samples/echobot
34+
WORKDIR /usr/src/maxbot-cpp/samples/echobot
3535
RUN rm -rf CMakeCache.txt CMakeFiles/ && \
3636
cmake . && make -j$(nproc)
3737

38-
WORKDIR /usr/src/tgbot-cpp/samples/echobot-curl-client
38+
WORKDIR /usr/src/maxbot-cpp/samples/echobot-curl-client
3939
RUN rm -rf CMakeCache.txt CMakeFiles/ && \
4040
cmake . && make -j$(nproc)
4141

42-
WORKDIR /usr/src/tgbot-cpp/samples/echobot-setmycommands
42+
WORKDIR /usr/src/maxbot-cpp/samples/echobot-setmycommands
4343
RUN rm -rf CMakeCache.txt CMakeFiles/ && \
4444
cmake . && make -j$(nproc)
4545

46-
WORKDIR /usr/src/tgbot-cpp
47-
RUN rm -rf samples/echobot-submodule/tgbot-cpp/
48-
COPY include samples/echobot-submodule/tgbot-cpp/include
49-
COPY src samples/echobot-submodule/tgbot-cpp/src
50-
COPY CMakeLists.txt samples/echobot-submodule/tgbot-cpp/
51-
WORKDIR /usr/src/tgbot-cpp/samples/echobot-submodule
46+
WORKDIR /usr/src/maxbot-cpp
47+
RUN rm -rf samples/echobot-submodule/maxbot-cpp/
48+
COPY include samples/echobot-submodule/maxbot-cpp/include
49+
COPY src samples/echobot-submodule/maxbot-cpp/src
50+
COPY CMakeLists.txt samples/echobot-submodule/maxbot-cpp/
51+
WORKDIR /usr/src/maxbot-cpp/samples/echobot-submodule
5252
RUN rm -rf CMakeCache.txt CMakeFiles/ && \
5353
cmake . && make -j$(nproc)
5454

55-
WORKDIR /usr/src/tgbot-cpp/samples/echobot-webhook-server
55+
WORKDIR /usr/src/maxbot-cpp/samples/echobot-webhook-server
5656
RUN rm -rf CMakeCache.txt CMakeFiles/ && \
5757
cmake . && make -j$(nproc)
5858

59-
WORKDIR /usr/src/tgbot-cpp/samples/inline-keyboard
59+
WORKDIR /usr/src/maxbot-cpp/samples/inline-keyboard
6060
RUN rm -rf CMakeCache.txt CMakeFiles/ && \
6161
cmake . && make -j$(nproc)
6262

63-
WORKDIR /usr/src/tgbot-cpp/samples/photo
63+
WORKDIR /usr/src/maxbot-cpp/samples/photo
6464
RUN rm -rf CMakeCache.txt CMakeFiles/ && \
6565
cmake . && make -j$(nproc)
6666

67-
WORKDIR /usr/src/tgbot-cpp/samples/received-text-processing
67+
WORKDIR /usr/src/maxbot-cpp/samples/received-text-processing
6868
RUN rm -rf CMakeCache.txt CMakeFiles/ && \
6969
cmake . && make -j$(nproc)
7070

71-
WORKDIR /usr/src/tgbot-cpp/samples/reply-keyboard
71+
WORKDIR /usr/src/maxbot-cpp/samples/reply-keyboard
7272
RUN rm -rf CMakeCache.txt CMakeFiles/ && \
7373
cmake . && make -j$(nproc)
7474

75-
WORKDIR /usr/src/tgbot-cpp/samples/receive-file
75+
WORKDIR /usr/src/maxbot-cpp/samples/receive-file
7676
RUN rm -rf CMakeCache.txt CMakeFiles/ && \
7777
cmake . && make -j$(nproc)
7878

79-
WORKDIR /usr/src/tgbot-cpp
79+
WORKDIR /usr/src/maxbot-cpp
8080
ENV CTEST_OUTPUT_ON_FAILURE=1
8181
CMD make test

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
3232
# title of most generated pages and in a few other places.
3333
# The default value is: My Project.
3434

35-
PROJECT_NAME = tgbot-cpp
35+
PROJECT_NAME = maxbot-cpp
3636

3737
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
3838
# could be handy for archiving the generated documentation or if some version

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015-2024 GitHub contributors https://github.com/reo7sp/tgbot-cpp/graphs/contributors
3+
Copyright (c) 2015-2024 GitHub contributors https://github.com/reo7sp/maxbot-cpp/graphs/contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# tgbot-cpp
1+
# maxbot-cpp
22

3-
[![GitHub contributors](https://img.shields.io/github/contributors/reo7sp/tgbot-cpp.svg)](https://github.com/reo7sp/tgbot-cpp/graphs/contributors)
3+
[![GitHub contributors](https://img.shields.io/github/contributors/reo7sp/maxbot-cpp.svg)](https://github.com/reo7sp/maxbot-cpp/graphs/contributors)
44

55
C++ library for Telegram bot API.
66

7-
Documentation is located [here](http://reo7sp.github.io/tgbot-cpp).
7+
Documentation is located [here](http://reo7sp.github.io/maxbot-cpp).
88

99

1010
## State
@@ -22,14 +22,14 @@ Simple echo bot which sends everything it receives:
2222

2323
```cpp
2424
#include <stdio.h>
25-
#include <tgbot/tgbot.h>
25+
#include <maxbot/maxbot.h>
2626

2727
int main() {
28-
TgBot::Bot bot("PLACE YOUR TOKEN HERE");
29-
bot.getEvents().onCommand("start", [&bot](TgBot::Message::Ptr message) {
28+
MaxBot::Bot bot("PLACE YOUR TOKEN HERE");
29+
bot.getEvents().onCommand("start", [&bot](MaxBot::Message::Ptr message) {
3030
bot.getApi().sendMessage(message->chat->id, "Hi!");
3131
});
32-
bot.getEvents().onAnyMessage([&bot](TgBot::Message::Ptr message) {
32+
bot.getEvents().onAnyMessage([&bot](MaxBot::Message::Ptr message) {
3333
printf("User wrote %s\n", message->text.c_str());
3434
if (StringTools::startsWith(message->text, "/start")) {
3535
return;
@@ -38,12 +38,12 @@ int main() {
3838
});
3939
try {
4040
printf("Bot username: %s\n", bot.getApi().getMe()->username.c_str());
41-
TgBot::TgLongPoll longPoll(bot);
41+
MaxBot::BotLongPoll longPoll(bot);
4242
while (true) {
4343
printf("Long poll started\n");
4444
longPoll.start();
4545
}
46-
} catch (TgBot::TgException& e) {
46+
} catch (MaxBot::BotException& e) {
4747
printf("error: %s\n", e.what());
4848
}
4949
return 0;
@@ -79,14 +79,14 @@ sudo apt install libboost-test-dev doxygen
7979
You can compile and install the library with these commands:
8080

8181
```sh
82-
git clone https://github.com/reo7sp/tgbot-cpp
83-
cd tgbot-cpp
82+
git clone https://github.com/reo7sp/maxbot-cpp
83+
cd maxbot-cpp
8484
cmake .
8585
make -j4
8686
sudo make install
8787
```
8888

89-
Alternatively, you can use Docker to build and run your bot. Set the base image of your's Dockerfile to [reo7sp/tgbot-cpp](https://hub.docker.com/r/reo7sp/tgbot-cpp/).
89+
Alternatively, you can use Docker to build and run your bot. Set the base image of your's Dockerfile to [reo7sp/maxbot-cpp](https://hub.docker.com/r/reo7sp/maxbot-cpp/).
9090

9191

9292
## Library installation on MacOS
@@ -102,7 +102,7 @@ You can compile and install the library like Linux instructions.
102102

103103
## Library installation on Windows
104104

105-
### Download vcpkg and tgbot-cpp
105+
### Download vcpkg and maxbot-cpp
106106

107107
Taken from [Vcpkg - Quick Start: Windows](https://github.com/Microsoft/vcpkg/#quick-start-windows).
108108

@@ -127,13 +127,13 @@ In order to use vcpkg with Visual Studio, run the following command (may require
127127
To install the libraries for Windows x64, run:
128128

129129
```cmd
130-
> .\vcpkg\vcpkg install tgbot-cpp:x64-windows
130+
> .\vcpkg\vcpkg install maxbot-cpp:x64-windows
131131
```
132132

133133
To install for Windows x86, run:
134134

135135
```cmd
136-
> .\vcpkg\vcpkg install tgbot-cpp
136+
> .\vcpkg\vcpkg install maxbot-cpp
137137
```
138138

139139
The library will now be installed and Visual Studio should be able to find the vcpkg installation.
@@ -143,7 +143,7 @@ The library will now be installed and Visual Studio should be able to find the v
143143
Use the [example CMakeLists.txt](samples/echobot/CMakeLists.txt) with changes:
144144

145145
1. Remove `/usr/local/include`
146-
2. Change `/usr/local/lib/libTgBot.a` to `C:/src/vcpkg/installed/x64-windows/lib/TgBot.lib` or something simmilar according to your own installation path.
146+
2. Change `/usr/local/lib/libMaxBot.a` to `C:/src/vcpkg/installed/x64-windows/lib/MaxBot.lib` or something simmilar according to your own installation path.
147147

148148

149149
## Bot compilation
@@ -157,7 +157,7 @@ Also, you can treat this repository as a submodule of your project, for example,
157157
### Without CMake
158158

159159
```sh
160-
g++ telegram_bot.cpp -o telegram_bot --std=c++14 -I/usr/local/include -lTgBot -lboost_system -lssl -lcrypto -lpthread
160+
g++ telegram_bot.cpp -o telegram_bot --std=c++14 -I/usr/local/include -lMaxBot -lboost_system -lssl -lcrypto -lpthread
161161
```
162162

163163
### Build options
@@ -170,4 +170,4 @@ g++ telegram_bot.cpp -o telegram_bot --std=c++14 -I/usr/local/include -lTgBot -l
170170

171171

172172
## Licence
173-
[The MIT License](https://github.com/reo7sp/tgbot-cpp/blob/master/LICENSE).
173+
[The MIT License](https://github.com/reo7sp/maxbot-cpp/blob/master/LICENSE).
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
#ifndef TGBOT_API_H
22
#define TGBOT_API_H
33

4-
#include "tgbot/TgException.h"
5-
#include "tgbot/TgTypeParser.h"
6-
#include "tgbot/net/HttpClient.h"
7-
#include "tgbot/net/HttpReqArg.h"
8-
#include "tgbot/tools/StringTools.h"
9-
#include "tgbot/types/User.h"
10-
#include "tgbot/types/Message.h"
11-
#include "tgbot/types/MessageId.h"
12-
#include "tgbot/types/GenericReply.h"
13-
#include "tgbot/types/InputFile.h"
14-
#include "tgbot/types/UserProfilePhotos.h"
15-
#include "tgbot/types/Update.h"
16-
#include "tgbot/types/InlineQueryResult.h"
17-
#include "tgbot/types/Venue.h"
18-
#include "tgbot/types/WebhookInfo.h"
19-
#include "tgbot/types/ChatMember.h"
20-
#include "tgbot/types/Sticker.h"
21-
#include "tgbot/types/StickerSet.h"
22-
#include "tgbot/types/File.h"
23-
#include "tgbot/types/InputMedia.h"
24-
#include "tgbot/types/GameHighScore.h"
25-
#include "tgbot/types/SentWebAppMessage.h"
26-
#include "tgbot/types/LabeledPrice.h"
27-
#include "tgbot/types/ShippingOption.h"
28-
#include "tgbot/types/BotCommand.h"
29-
#include "tgbot/types/ForumTopic.h"
4+
#include "maxbot/BotException.h"
5+
#include "maxbot/BotTypeParser.h"
6+
#include "maxbot/net/HttpClient.h"
7+
#include "maxbot/net/HttpReqArg.h"
8+
#include "maxbot/tools/StringTools.h"
9+
#include "maxbot/types/User.h"
10+
#include "maxbot/types/Message.h"
11+
#include "maxbot/types/MessageId.h"
12+
#include "maxbot/types/GenericReply.h"
13+
#include "maxbot/types/InputFile.h"
14+
#include "maxbot/types/UserProfilePhotos.h"
15+
#include "maxbot/types/Update.h"
16+
#include "maxbot/types/InlineQueryResult.h"
17+
#include "maxbot/types/Venue.h"
18+
#include "maxbot/types/WebhookInfo.h"
19+
#include "maxbot/types/ChatMember.h"
20+
#include "maxbot/types/Sticker.h"
21+
#include "maxbot/types/StickerSet.h"
22+
#include "maxbot/types/File.h"
23+
#include "maxbot/types/InputMedia.h"
24+
#include "maxbot/types/GameHighScore.h"
25+
#include "maxbot/types/SentWebAppMessage.h"
26+
#include "maxbot/types/LabeledPrice.h"
27+
#include "maxbot/types/ShippingOption.h"
28+
#include "maxbot/types/BotCommand.h"
29+
#include "maxbot/types/ForumTopic.h"
3030

3131
#include <boost/property_tree/ptree.hpp>
3232
#include <boost/variant.hpp>
@@ -37,7 +37,7 @@
3737
#include <utility>
3838
#include <vector>
3939

40-
namespace TgBot {
40+
namespace MaxBot {
4141

4242
class Bot;
4343

@@ -2244,7 +2244,7 @@ friend class Bot;
22442244
boost::property_tree::ptree sendRequest(const std::string& method, const std::vector<HttpReqArg>& args = std::vector<HttpReqArg>()) const;
22452245

22462246
const std::string _token;
2247-
const TgTypeParser _tgTypeParser;
2247+
const BotTypeParser _botTypeParser;
22482248
const std::string _url;
22492249
};
22502250
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#ifndef TGBOT_CPP_BOT_H
22
#define TGBOT_CPP_BOT_H
33

4-
#include "tgbot/Api.h"
5-
#include "tgbot/EventHandler.h"
4+
#include "maxbot/Api.h"
5+
#include "maxbot/EventHandler.h"
66

77
#include <memory>
88
#include <string>
99
#include <utility>
1010

11-
namespace TgBot {
11+
namespace MaxBot {
1212

1313
class EventBroadcaster;
1414
class HttpClient;
@@ -45,7 +45,7 @@ class TGBOT_API Bot {
4545
}
4646

4747
/**
48-
* @return Object which handles new update objects. Usually it's only needed for TgLongPoll, TgWebhookLocalServer and TgWebhookTcpServer objects.
48+
* @return Object which handles new update objects. Usually it's only needed for BotLongPoll, BotWebhookLocalServer and BotWebhookTcpServer objects.
4949
*/
5050
inline const EventHandler& getEventHandler() const {
5151
return _eventHandler;

0 commit comments

Comments
 (0)