Skip to main content
All projects

CppGram

A C++20 Telegram client framework over TDLib with a Pyrogram-shaped API, composable boolean filters and Result-typed error handling.

Open source
Project
Client framework
Language
C++
Started
2026-05

The story

CppGram wraps TDLib 1.8.0 in an API shaped like Pyrogram's, because the ergonomics of the Python client are the reason people tolerate writing Telegram bots at all.

The filter algebra is the piece I like: overloaded && , || and ! compose handler predicates into something that reads as a sentence, with no runtime cost over hand-written conditionals. Errors come back as Result<T> rather than exceptions, which suits a library that will be embedded in other people's event loops.

Under the hood

The decisions that make it work.

Filter algebra
Operator overloads make handler conditions read as expressions: Filters::text() && Filters::privateChat() && !Filters::bot().
Native core
Hand-written TDLib object mapping with Result<T> error returns instead of exceptions, wired up through CMake.

Built with

  • C++20
  • TDLib
  • CMake
  • OpenSSL