eSeGeCe
software
The sgcTelegram component family blends the power of the official Telegram Database Library with the rapid productivity of Delphi. This article describes how to configure and embed the component in your applications, showcases commercial use cases, and highlights why it is a strategic asset for your communication workflows.
Why Choose sgcTelegram for Delphi
Follow these steps to drop the component on a VCL or FMX form and prepare it for production use:
The following example demonstrates a commercial-grade notification console that logs in as a bot, sends a welcome message, and stores customer replies:
procedure TfrmTelegram.ConsoleAuthorize;
begin
sgcTelegramClient1.Manager.LibraryPath := IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0))) + 'tdlib';
sgcTelegramClient1.Manager.DatabasePath := GetHomePath + PathDelim + 'TelegramCache';
sgcTelegramClient1.ApiId := <YOUR_API_ID>;
sgcTelegramClient1.ApiHash := '<YOUR_API_HASH>';
sgcTelegramClient1.PhoneNumber := '<COMPANY_BOT_TOKEN>';
sgcTelegramClient1.ApplicationVersion := '2.0';
sgcTelegramClient1.DeviceModel := 'Retail Notification Hub';
sgcTelegramClient1.SystemLanguageCode := 'en';
sgcTelegramClient1.Options.UseTestDataCenter := False;
sgcTelegramClient1.Connect;
end;
procedure TfrmTelegram.sgcTelegramClient1AuthorizationState(Sender: TObject;
const AState: TsgcTelegramAuthorizationState);
begin
if AState.State = asReady then
begin
sgcTelegramClient1.Messages.SendMessage('<CUSTOMER_CHAT_ID>', 'Your order has shipped! Track it via our portal.');
end;
end;
procedure TfrmTelegram.sgcTelegramClient1NewMessage(Sender: TObject;
const AMessage: TsgcTelegramMessage);
begin
MemoConsole.Lines.Add(Format('[%s] %s', [DateTimeToStr(Now), AMessage.Content.Text.Text]));
end;
This snippet illustrates how to configure file system paths, credentials, and event handlers. Replace placeholders with your production bot token and chat identifiers.
Include the Telegram component in your next release to elevate customer communications, accelerate feature delivery, and unlock new revenue streams. Contact our sales team for licensing bundles or customized consulting engagements tailored to your vertical.
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.