Skip to content

Commit b30a292

Browse files
committed
Add JSON serialization for all Telegram Bot API types
Implemented robust JSON parsing and serialization for all Telegram Bot API data structures using nlohmann/json. Each type now includes functions for converting between C++ objects and JSON, supporting nested objects, arrays, and polymorphic types. This enables seamless integration of Telegram data in C++ applications and modernizes the codebase for future API updates.
1 parent 77618ec commit b30a292

299 files changed

Lines changed: 32633 additions & 9105 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.

‎CMakeLists.txt‎

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,20 @@ find_package(CURL 7.58.0)
2626
## nlohmann_json
2727
find_package(nlohmann_json 3.2.0 REQUIRED)
2828

29-
set(SRC_LIST
30-
src/Api.cpp
31-
src/Bot.cpp
32-
src/EventHandler.cpp
33-
src/TgTypeParser.cpp
34-
src/net/BoostSslClient.cpp
35-
src/net/HttpParser.cpp
36-
src/net/TgLongPoll.cpp
37-
src/net/Url.cpp
38-
src/tools/StringTools.cpp)
29+
file(GLOB SRC_LIST CONFIGURE_DEPENDS
30+
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
31+
"${CMAKE_CURRENT_SOURCE_DIR}/src/net/*.cpp"
32+
"${CMAKE_CURRENT_SOURCE_DIR}/src/tools/*.cpp"
33+
"${CMAKE_CURRENT_SOURCE_DIR}/src/types/*.cpp"
34+
)
3935

40-
if (CURL_FOUND)
41-
list(APPEND SRC_LIST src/net/CurlHttpClient.cpp)
36+
if (NOT CURL_FOUND)
37+
list(REMOVE_ITEM SRC_LIST "${CMAKE_CURRENT_SOURCE_DIR}/src/net/CurlHttpClient.cpp")
4238
endif()
4339

4440
# building project
4541
add_library(${PROJECT_NAME} ${SRC_LIST})
4642

47-
if(MSVC)
48-
target_compile_options(${PROJECT_NAME} PRIVATE /bigobj)
49-
endif()
50-
5143
# sources
5244
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17)
5345
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD_REQUIRED 17)

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Documentation is located [here](http://reo7sp.github.io/tgbot-cpp).
99

1010
## State
1111

12-
This library implements most features from **Telegram Bot API 9.4** with additional features from later versions. (WIP)
12+
This library implements most features from **Telegram Bot API 9.4** with additional features from later versions.
1313

1414
## Sample
1515

0 commit comments

Comments
 (0)