Skip to content

Commit 1c5fddc

Browse files
committed
Merge branch 'release/3.3.1'
2 parents 3b8c124 + 98e581c commit 1c5fddc

40 files changed

+3526
-7251
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,4 @@ __recovery/
7373
Demo/token.inc
7474
Demo/freelance/
7575
Install/TTelegramBot.dcr
76+
Demo/EchoBot/Android/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "modules/DJSON"]
2+
path = modules/DJSON
3+
url=https://github.com/mauriziodm/DJSON.git

Delphinus.Info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": [],
1313
"author": "M.E.Sysoev",
1414
"description": "Telegram Bot API for Delphi",
15-
"version": "3.3.0",
15+
"version": "3.3.1",
1616
"first_version": "2.3.1",
1717
"project_url": "https://github.com/ms301/TelegAPI",
1818
"homepage_url": "https://t.me/telegaPiBotTest",

Demo/Console/ConsoleBot.dproj

Lines changed: 137 additions & 136 deletions
Large diffs are not rendered by default.

Demo/DonateMe/DonateMe.dpr

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
program DonateMe;
2+
3+
{$APPTYPE CONSOLE}
4+
5+
{$R *.res}
6+
7+
uses
8+
TelegAPI.Bot.Console,
9+
TelegAPI.Types,
10+
TelegAPI.Helpers,
11+
System.SysUtils;
12+
13+
procedure Main;
14+
var
15+
LBot: TTelegramBotConsole;
16+
LStop, LToken: string;
17+
begin
18+
LBot := TTelegramBotConsole.Create('');
19+
repeat
20+
Write('Paste valid token from @botFather: ');
21+
Readln(LToken);
22+
LBot.Token := LToken;
23+
until (LBot.IsValidToken);
24+
try
25+
LBot.OnConnect :=
26+
procedure
27+
begin
28+
Writeln('Connected');
29+
end;
30+
LBot.OnMessage :=
31+
procedure(AMessage: TTgMessage)
32+
begin
33+
Writeln(AMessage.From.Username, ': ', AMessage.Text);
34+
if AMessage.IsCommand('/donate') then
35+
LBot.SendInvoice(AMessage.Chat.ID, 'Поддержать автора', 'Кинуть автору на мяско', 'Payload', '381764678:TEST:1848', 'start_parameter', 'RUB', [TtgLabeledPrice.Create('label', 6000)], 'http://assets.fridge.menu/i/good/photo/55/03/5c/21/52/75/52/18/d7/cd/24/00/full_551a83d152755296f1696900.jpg', 120, 120, 120, True);
36+
end;
37+
with LBot.GetMe do
38+
begin
39+
Writeln('Bot nick: ', Username);
40+
Free;
41+
end;
42+
LBot.IsReceiving := True;
43+
while LStop.ToLower.Trim <> 'exit' do
44+
Readln(LStop);
45+
finally
46+
LBot.Free;
47+
end;
48+
end;
49+
50+
begin
51+
try
52+
{ TODO -oUser -cConsole Main : Insert code here }
53+
Main;
54+
except
55+
on E: Exception do
56+
Writeln(E.ClassName, ': ', E.Message);
57+
end;
58+
end.
59+

Demo/DonateMe/DonateMe.dproj

Lines changed: 568 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- BEGIN_INCLUDE(manifest) -->
3+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
4+
package="%package%"
5+
android:versionCode="%versionCode%"
6+
android:versionName="%versionName%"
7+
android:installLocation="%installLocation%">
8+
9+
<!-- This is the platform API where NativeActivity was introduced. -->
10+
<uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="%targetSdkVersion%" />
11+
<%uses-permission%>
12+
<uses-feature android:glEsVersion="0x00020000" android:required="True"/>
13+
<application android:persistent="%persistent%"
14+
android:restoreAnyVersion="%restoreAnyVersion%"
15+
android:label="%label%"
16+
android:debuggable="%debuggable%"
17+
android:largeHeap="%largeHeap%"
18+
android:icon="%icon%"
19+
android:theme="%theme%"
20+
android:hardwareAccelerated="%hardwareAccelerated%">
21+
22+
<%application-meta-data%>
23+
<%services%>
24+
<!-- Our activity is a subclass of the built-in NativeActivity framework class.
25+
This will take care of integrating with our NDK code. -->
26+
<activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
27+
android:label="%activityLabel%"
28+
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
29+
android:launchMode="singleTask">
30+
<!-- Tell NativeActivity the name of our .so -->
31+
<meta-data android:name="android.app.lib_name"
32+
android:value="%libNameValue%" />
33+
<intent-filter>
34+
<action android:name="android.intent.action.MAIN" />
35+
<category android:name="android.intent.category.LAUNCHER" />
36+
</intent-filter>
37+
</activity>
38+
<%activity%>
39+
<%receivers%>
40+
</application>
41+
</manifest>
42+
<!-- END_INCLUDE(manifest) -->

Demo/EchoBot/EchoBot.Main.fmx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ object Main: TMain
1212
object mmoLog: TMemo
1313
Touch.InteractiveGestures = [Pan, LongTap, DoubleTap]
1414
DataDetectorTypes = []
15+
ReadOnly = True
1516
Align = Client
1617
Size.Width = 453.000000000000000000
1718
Size.Height = 376.000000000000000000
@@ -43,6 +44,7 @@ object Main: TMain
4344
Touch.InteractiveGestures = [LongTap, DoubleTap]
4445
Align = Client
4546
TabOrder = 1
47+
Text = '283107814:AAGokguMcF9SaI_f-M7vDmS9E2ugZrjumfk'
4648
Margins.Right = 5.000000000000000000
4749
Size.Width = 346.000000000000000000
4850
Size.Height = 23.000000000000000000
@@ -62,16 +64,20 @@ object Main: TMain
6264
end
6365
end
6466
object tgBot: TTelegramBot
65-
OnMessage = tgBotMessage
66-
OnMessageEdited = tgBotMessage
67-
OnInlineQuery = tgBotInlineQuery
68-
OnInlineResultChosen = tgBotInlineResultChosen
69-
OnCallbackQuery = tgBotCallbackQuery
7067
OnReceiveError = tgBotReceiveError
7168
OnReceiveGeneralError = tgBotReceiveGeneralError
72-
OnConnect = tgBotConnect
73-
OnDisconnect = tgBotDisconnect
69+
Left = 104
70+
Top = 168
71+
end
72+
object TgBotAsync1: TTgBotAsync
73+
Bot = tgBot
74+
OnMessage = TgBotAsync1Message
75+
OnInlineQuery = TgBotAsync1InlineQuery
76+
OnInlineResultChosen = TgBotAsync1InlineResultChosen
77+
OnCallbackQuery = TgBotAsync1CallbackQuery
78+
OnConnect = TgBotAsync1Connect
79+
OnDisconnect = TgBotAsync1Disconnect
7480
Left = 216
75-
Top = 88
81+
Top = 152
7682
end
7783
end

0 commit comments

Comments
 (0)