Telegram TDLib API
Build Telegram bots and full-featured clients using the Telegram Database Library (TDLib) directly from Delphi.
Build Telegram bots and full-featured clients using the Telegram Database Library (TDLib) directly from Delphi.
Access the full Telegram API through TDLib for building bots, managing chats, sending media, and handling real-time updates.
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.
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;
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.