Thanks to visit codestin.com
Credit goes to github.com

Skip to content

kin4stat/banana

 
 

Repository files navigation

License: MIT GitHub Actions GitHub Actions

🍌 banana - thin wrapper over Telegram Bot API written in C++17.

Key Features

  • Simple API
  • Single interface for both blocking, non-blocking and even coroutine-based operations
  • Generic in terms of networking backend (bundled support for WinAPI, cpr and boost::beast)
  • Extendable (see custom-agent example)
  • Automatically generated from Telegram Bot API 7.1 (thanks ark0f/tg-bot-api)
  • Cross-platform (tested on Windows, Linux, macOS)

Example

#include <banana/api.hpp>
#include <banana/agent/default.hpp>

int main(int argc, char** argv) {
    // create agent once
    banana::agent::default_blocking agent("<TG_BOT_TOKEN>");

    // use API
    banana::api::send_message(agent, { .chat_id = "@smertig", .text = "Hello, world!" });
    
    // or in C++17
    banana::api::send_message_args_t args;
    args.chat_id = "@smertig";
    args.text = "Hello, world!";
    banana::api::send_message(agent, std::move(args));
}

Documentation

Previous Release

Latest Release

Master

About

🍌 Modern C++ Telegram Bot API library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 98.0%
  • Python 1.7%
  • CMake 0.3%