https://github.com/hemulgm/tgbotmini
Telegram Bot Mini API
https://github.com/hemulgm/tgbotmini
delphi telegram-bot telegram-bot-api
Last synced: about 2 months ago
JSON representation
Telegram Bot Mini API
- Host: GitHub
- URL: https://github.com/hemulgm/tgbotmini
- Owner: HemulGM
- License: mit
- Created: 2021-12-05T22:49:35.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-30T15:16:54.000Z (over 1 year ago)
- Last Synced: 2025-02-27T17:36:13.087Z (7 months ago)
- Topics: delphi, telegram-bot, telegram-bot-api
- Language: Pascal
- Homepage:
- Size: 178 KB
- Stars: 36
- Watchers: 8
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TGBotMini
Telegram Bot Mini API```Pascal
program TGBotMini;uses
System.SysUtils,
TgBotApi in 'TgBotApi.pas',
TgBotApi.Client in 'TgBotApi.Client.pas',
HGM.ArrayHelpers in 'ArrayHelpers\HGM.ArrayHelpers.pas',
HGM.JSONParams in 'JSONParam\HGM.JSONParams.pas',
TgBotProc.Test in 'TgBotProc.Test.pas';begin
Client := TtgClient.Create({$INCLUDE BOT_TOKEN.key});
Client.Logging := True;
Client.OnTextOut :=
procedure(const Text: string)
begin
Writeln(Text);
end;
Client.Subscribe(ProcCallbackQuery);
Client.Subscribe(ProcMenu, '/menu');
Client.Subscribe(ProcStart, '/start');
Client.Subscribe(ProcPhoto, '/photo');
while True do
try
Client.Hello;
Client.Polling;
except
on E: Exception do
begin
Writeln('Error: ' + E.Message);
Sleep(5000);
end;
end;
Client.Free;
end.
```