Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/HemulGM/TGBotMini
Telegram Bot Mini API
https://github.com/HemulGM/TGBotMini
delphi telegram-bot telegram-bot-api
Last synced: about 1 month 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 (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-08T10:37:13.000Z (9 months ago)
- Last Synced: 2024-01-06T22:22:20.205Z (5 months ago)
- Topics: delphi, telegram-bot, telegram-bot-api
- Language: Pascal
- Homepage:
- Size: 162 KB
- Stars: 22
- Watchers: 8
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-pascal - TGBot Mini API
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.
```