https://github.com/xeimsuck/zola
Library for working with Telegram API
https://github.com/xeimsuck/zola
api cpp library telegram telegram-api telegram-bot telegram-bot-api
Last synced: about 2 months ago
JSON representation
Library for working with Telegram API
- Host: GitHub
- URL: https://github.com/xeimsuck/zola
- Owner: xeimsuck
- Created: 2024-08-08T14:34:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-27T12:51:56.000Z (over 1 year ago)
- Last Synced: 2025-10-04T17:51:34.737Z (6 months ago)
- Topics: api, cpp, library, telegram, telegram-api, telegram-bot, telegram-bot-api
- Language: C++
- Homepage:
- Size: 320 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Zola
****
## About
Library for working with Telegram API.
## Dependencies
**Languages:** C++20
**Build systems:** CMake, Make
**Libraries:** libcurl, nlohmann/json, magic_enum
## Documentation
Create documentation with doxygen
```shell
doxygen doxygen.conf
cd documentation/html
# open index.html file
```
It will be deployed soon
## Hot to build
1. Create a build directory and navigate into it
```shell
mkdir build
cd build
```
2. Build a project with cmake
```shell
cmake ..
make
sudo make install
# if possible use -j4 with make
```
## Project examples
### Echo bot
```c++
#include
using namespace Zola;
int main(int argc, char*argv[]){
// Create a bot with your token
auto& bot = Bot::init("7047048031:AAEbb5yTcq5Gd86ecYjnsUg2Qore3pgAAzg");
// Add handler on any messages
bot.getEventHandler().getMessageHandler().addAny([&](const Objects::Message& msg){
// Send a message which bot received
bot.getAPI().sendMessage(msg.text.value_or("It is not message"), msg.chat.id);
});
try {
// Run a bot
bot.run();
} catch (const std::exception& ex){
std::cerr << ex.what();
return 1;
}
return 0;
}
```