Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

tgbot-cpp

> 编程语言
Open source

C++ library for Telegram bot API

1.2K stars0 likes2 views
WebsiteGitHub

About

C++ library for Telegram bot API

tgbot-cpp

C++ library for Telegram bot API.

Documentation is located here.

State

  • Telegram Bot API 10.3.

Example

Simple echo bot which sends everything it receives:

cpp
#include 
#include 

#include 

int main() {
    TgBot::Bot bot("PLACE YOUR TOKEN HERE");
    bot.getEvents().onCommand("start", [&bot](std::shared_ptr message) {
        bot.getApi().sendMessage(message->chat->id, "Hi!");
    });
    bot.getEvents().onAnyMessage([&bot](std::shared_ptr message) {
        const auto text = message->text.value_or("");
        std::cout chat->id, "Your message is: " + text);
    });
    try {
        std::cout username.value_or("") =22.1.8"

Developing tgbot-cpp

Development checks are exposed through the Makefile:

bash
make format
make lint
make test

Alternatively, via Docker:

bash
make docker-test

Updating Telegram Bot API types

Help page.

Licence

The MIT License.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++botcpptelegramtelegram-api

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言