Skip to content

Commit

Permalink
Merge branch 'release/3.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
rareMaxim committed Oct 3, 2017
2 parents 3b8c124 + 98e581c commit 1c5fddc
Show file tree
Hide file tree
Showing 40 changed files with 3,526 additions and 7,251 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ __recovery/
Demo/token.inc
Demo/freelance/
Install/TTelegramBot.dcr
Demo/EchoBot/Android/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "modules/DJSON"]
path = modules/DJSON
url=https://github.com/mauriziodm/DJSON.git
2 changes: 1 addition & 1 deletion Delphinus.Info.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": [],
"author": "M.E.Sysoev",
"description": "Telegram Bot API for Delphi",
"version": "3.3.0",
"version": "3.3.1",
"first_version": "2.3.1",
"project_url": "https://github.com/ms301/TelegAPI",
"homepage_url": "https://t.me/telegaPiBotTest",
Expand Down
273 changes: 137 additions & 136 deletions Demo/Console/ConsoleBot.dproj

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions Demo/DonateMe/DonateMe.dpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
program DonateMe;

{$APPTYPE CONSOLE}

{$R *.res}

uses
TelegAPI.Bot.Console,
TelegAPI.Types,
TelegAPI.Helpers,
System.SysUtils;

procedure Main;
var
LBot: TTelegramBotConsole;
LStop, LToken: string;
begin
LBot := TTelegramBotConsole.Create('');
repeat
Write('Paste valid token from @botFather: ');
Readln(LToken);
LBot.Token := LToken;
until (LBot.IsValidToken);
try
LBot.OnConnect :=
procedure
begin
Writeln('Connected');
end;
LBot.OnMessage :=
procedure(AMessage: TTgMessage)
begin
Writeln(AMessage.From.Username, ': ', AMessage.Text);
if AMessage.IsCommand('/donate') then
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);
end;
with LBot.GetMe do
begin
Writeln('Bot nick: ', Username);
Free;
end;
LBot.IsReceiving := True;
while LStop.ToLower.Trim <> 'exit' do
Readln(LStop);
finally
LBot.Free;
end;
end;

begin
try
{ TODO -oUser -cConsole Main : Insert code here }
Main;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.

568 changes: 568 additions & 0 deletions Demo/DonateMe/DonateMe.dproj

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions Demo/EchoBot/AndroidManifest.template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="%package%"
android:versionCode="%versionCode%"
android:versionName="%versionName%"
android:installLocation="%installLocation%">

<!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="%targetSdkVersion%" />
<%uses-permission%>
<uses-feature android:glEsVersion="0x00020000" android:required="True"/>
<application android:persistent="%persistent%"
android:restoreAnyVersion="%restoreAnyVersion%"
android:label="%label%"
android:debuggable="%debuggable%"
android:largeHeap="%largeHeap%"
android:icon="%icon%"
android:theme="%theme%"
android:hardwareAccelerated="%hardwareAccelerated%">

<%application-meta-data%>
<%services%>
<!-- Our activity is a subclass of the built-in NativeActivity framework class.
This will take care of integrating with our NDK code. -->
<activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
android:label="%activityLabel%"
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
android:launchMode="singleTask">
<!-- Tell NativeActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="%libNameValue%" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<%activity%>
<%receivers%>
</application>
</manifest>
<!-- END_INCLUDE(manifest) -->
22 changes: 14 additions & 8 deletions Demo/EchoBot/EchoBot.Main.fmx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ object Main: TMain
object mmoLog: TMemo
Touch.InteractiveGestures = [Pan, LongTap, DoubleTap]
DataDetectorTypes = []
ReadOnly = True
Align = Client
Size.Width = 453.000000000000000000
Size.Height = 376.000000000000000000
Expand Down Expand Up @@ -43,6 +44,7 @@ object Main: TMain
Touch.InteractiveGestures = [LongTap, DoubleTap]
Align = Client
TabOrder = 1
Text = '283107814:AAGokguMcF9SaI_f-M7vDmS9E2ugZrjumfk'
Margins.Right = 5.000000000000000000
Size.Width = 346.000000000000000000
Size.Height = 23.000000000000000000
Expand All @@ -62,16 +64,20 @@ object Main: TMain
end
end
object tgBot: TTelegramBot
OnMessage = tgBotMessage
OnMessageEdited = tgBotMessage
OnInlineQuery = tgBotInlineQuery
OnInlineResultChosen = tgBotInlineResultChosen
OnCallbackQuery = tgBotCallbackQuery
OnReceiveError = tgBotReceiveError
OnReceiveGeneralError = tgBotReceiveGeneralError
OnConnect = tgBotConnect
OnDisconnect = tgBotDisconnect
Left = 104
Top = 168
end
object TgBotAsync1: TTgBotAsync
Bot = tgBot
OnMessage = TgBotAsync1Message
OnInlineQuery = TgBotAsync1InlineQuery
OnInlineResultChosen = TgBotAsync1InlineResultChosen
OnCallbackQuery = TgBotAsync1CallbackQuery
OnConnect = TgBotAsync1Connect
OnDisconnect = TgBotAsync1Disconnect
Left = 216
Top = 88
Top = 152
end
end
Loading

0 comments on commit 1c5fddc

Please sign in to comment.