Telegram TDLib Client
Build Telegram user-account or bot applications in Delphi/C++Builder. Wraps the official Telegram TDLib to expose authentication, chats, messages and update events.
Build Telegram user-account or bot applications in Delphi/C++Builder. Wraps the official Telegram TDLib to expose authentication, chats, messages and update events.
Delphi/C++Builder wrapper for the official Telegram TDLib (tdjson). Handles client_id lifecycle, authentication state, message send/receive and the long-poll update stream.
TsgcTDLib_Telegram
Windows, macOS, Linux, iOS, Android
Standard / Professional / Enterprise
Set ApiId / ApiHash, point the component at the tdjson library, hook OnTelegramUpdate for authentication state and start sending messages.
uses
sgcLibs;
var
Telegram: TsgcTDLib_Telegram;
begin
Telegram := TsgcTDLib_Telegram.Create(nil);
Telegram.TDLibParameters.ApiId := 123456;
Telegram.TDLibParameters.ApiHash := 'your-api-hash';
Telegram.LibraryPath := 'tdjson.dll';
Telegram.OnTelegramUpdate := procedure(Sender: TObject;
const aUpdate: string)
begin
Memo1.Lines.Add(aUpdate);
end;
Telegram.Active := True;
Telegram.SendMessage('@username', 'hello from Delphi');
end;
// uses: sgcLibs
TsgcTDLib_Telegram *Telegram = new TsgcTDLib_Telegram(this);
Telegram->TDLibParameters->ApiId = 123456;
Telegram->TDLibParameters->ApiHash = "your-api-hash";
Telegram->LibraryPath = "tdjson.dll";
Telegram->Active = true;
Telegram->SendMessage("@username", "hello from Delphi");
A Delphi facade over the official TDLib (tdjson) shared library — same protocol the official Telegram clients use.
The component drives the TDLib authentication state machine: phone number, code, optional 2FA password, and persists the session under the local database directory.
SendMessage, SendPhoto, SendVideo, SendDocument, SendVoiceNote and other typed methods cover the TDLib message-content types.
GetChats, GetChat, SearchPublicChat and GetUser expose the Telegram address book and joined channels/groups as typed responses.
OnTelegramUpdate delivers every TDLib updateXxx event — new messages, user typing, channel posts, edits, deletions — as raw JSON for downstream routing.
Uses the official tdjson.dll / libtdjson.so / libtdjson.dylib — same end-to-end encryption guarantees as the official Telegram client.
TDLib ships for Windows, macOS, Linux, Android and iOS. Configure LibraryPath per platform; the component handles the typed bridging for you.
Authoritative sources for the API this component implements.
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.
| Online Help — API_Telegram Full property, method and event reference for this component. | Open | |
| Demo Project — Demos\50.Other\01.Telegram_Client Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |