Telegram TDLib API

Build Telegram bots and full-featured clients using the Telegram Database Library (TDLib) directly from Delphi.

Telegram Integration

Access the full Telegram API through TDLib for building bots, managing chats, sending media, and handling real-time updates.

Full Telegram Platform Access

sgcWebSockets wraps the Telegram TDLib library, giving you access to every Telegram feature: messaging, groups, channels, media, stickers, inline bots, and more. The component handles authentication, connection management, and automatic reconnection.

  • Send and receive text, photo, video, and document messages
  • Bot API support with command handling and inline keyboards
  • Group and channel management
  • Real-time update handling with event callbacks
  • TDLib-based for reliable, high-performance operation

Delphi Telegram Example

Connect to Telegram and send messages with a few lines of code.

uses
  sgcHTTP_API_Telegram;

var
  Telegram: TsgcHTTPAPI_Telegram;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Telegram := TsgcHTTPAPI_Telegram.Create(nil);
  Telegram.TelegramOptions.BotToken := 'your-bot-token';
  Telegram.OnTelegramMessage := OnMessage;
  Telegram.Start;
end;

procedure TForm1.OnMessage(Sender: TObject;
  aMessage: TsgcTelegramMessage);
begin
  // Echo back the received message
  Telegram.SendMessage(aMessage.ChatId,
    'Received: ' + aMessage.Text);
end;

Documentation & Demos

Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.

Ready to Build with Telegram?

Download the free trial and start building Telegram bots and clients today.