Skip to content

Commit

Permalink
April 21, 2023 Bot API 6.7
Browse files Browse the repository at this point in the history
April 21, 2023
Bot API 6.7

Added support for launching Web Apps from inline query results by replacing the parameters switch_pm_text and switch_pm_parameter of the method answerInlineQuery with the parameter button of type InlineQueryResultsButton.
Added the field web_app_name to the class WriteAccessAllowed.
Added the field switch_inline_query_chosen_chat of the type SwitchInlineQueryChosenChat to the class InlineKeyboardButton, which allows bots to switch to inline mode in a chosen chat of the given type.
Added the field via_chat_folder_invite_link to the class ChatMemberUpdated.
Added the ability to set different bot names for different user languages using the method setMyName.
Added the ability to get the current bot name in the given language as the class BotName using the method getMyName.
Added the ability to change bot settings from the bot's profile in official Telegram apps, including the ability to set animated profile photos.
Added the ability to specify custom emoji entities using HTML and MarkdownV2 formatting options for bots that purchased additional usernames on Fragment.

added new event OnWebAppData in the Component TInjectTelegramBotManager to receiver all data from webapp on bot
  • Loading branch information
dieletro committed Jul 27, 2023
1 parent dd8a31a commit fc201b3
Show file tree
Hide file tree
Showing 115 changed files with 42,258 additions and 10 deletions.
20 changes: 10 additions & 10 deletions v1.4.3/Exemplo/uPrincipal.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -3848,9 +3848,9 @@ object Form1: TForm1
object btnEnviarTxtComBTInline: TButton
Left = 146
Top = 159
Width = 137
Width = 151
Height = 25
Caption = 'Send Text w/ Buttons Inline'
Caption = 'Send Text w/ Inline Buttons '
Default = True
TabOrder = 19
OnClick = btnEnviarTxtComBTInlineClick
Expand Down Expand Up @@ -3952,9 +3952,9 @@ object Form1: TForm1
OnClick = EnviarFotoSpoilerClick
end
object SendTextTopic: TButton
Left = 289
Top = 159
Width = 137
Left = 146
Top = 190
Width = 151
Height = 25
Caption = 'Send Text for Topic'
Default = True
Expand Down Expand Up @@ -4135,8 +4135,8 @@ object Form1: TForm1
end
object InjectTelegramExceptionManagerUI1: TInjectTelegramExceptionManagerUI
OnLog = InjectTelegramExceptionManagerUI1Log
Left = 208
Top = 326
Left = 488
Top = 438
end
object cuHttpClientSysNet1: TcuHttpClientSysNet
Left = 488
Expand All @@ -4155,8 +4155,8 @@ object Form1: TForm1
OnReceiveRawData = InjectTelegramBot1ReceiveRawData
OnSendData = InjectTelegramBot1SendData
OnDisconect = InjectTelegramBot1Disconect
Left = 48
Top = 326
Left = 488
Top = 382
end
object BotManager1: TInjectTelegramBotManager
Bot = InjectTelegramBot1
Expand All @@ -4181,6 +4181,6 @@ object Form1: TForm1
OnGeneralForumTopicUnhidden = BotManager1GeneralForumTopicUnhidden
OnMessageEntityReceiver = BotManager1MessageEntityReceiver
Left = 360
Top = 328
Top = 400
end
end
94 changes: 94 additions & 0 deletions v1.4.4/CrossUrl/Core/CrossUrl.HttpClient.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
unit CrossUrl.HttpClient;

interface

uses
System.Classes,
System.SysUtils;

type
TcuProxy = record
private
FHost: string;
FPort: Integer;
FUserName: string;
FPassword: string;
public
constructor Create(const AHost: string; APort: Integer; const AUserName:
string = ''; const APassword: string = '');
property Host: string read FHost write FHost;
property Port: Integer read FPort write FPort;
property UserName: string read FUserName write FUserName;
property Password: string read FPassword write FPassword;
end;

IcuUri = interface
['{46DF4232-C572-45F8-8CAB-86096F32FA66}']
function GetScheme: string;
procedure SetScheme(const Value: string);
property Scheme: string read GetScheme write SetScheme;
end;

IcuMultipartFormData = interface
['{C1FEF918-67B9-4503-B67F-AD942F16FEB3}']
function GetStream: TStream;
//
procedure AddField(const AField, AValue: string);
procedure AddFile(const AFieldName, AFilePath: string);
/// <summary>
/// Add a form data Stream
/// </summary>
/// <param name="AFieldName">
/// Field Name
/// </param>
/// <param name="Data">
/// Stream
/// </param>
/// <param name="AFileName">
/// file name: "File.ext"
/// </param>
procedure AddStream(const AFieldName: string; Data: TStream; const AFileName:
string = '');
property Stream: TStream read GetStream;
end;

IcuHttpResponse = interface
['{44F74F9B-CCD2-475E-95E0-02DA30AC749D}']
//private
function GetStatusCode: Integer;
function GetStatusText: string;
function GetContentStream: TStream;
//public
property StatusText: string read GetStatusText;
property StatusCode: Integer read GetStatusCode;
property ContentStream: TStream read GetContentStream;
function ContentAsString(const AnEncoding: TEncoding = nil): string;
end;

IcuHttpClient = interface
['{EB3348C4-5651-4BAB-988D-A28794FEB149}']
function GetProxy: TcuProxy;
procedure SetProxy(const AProxy: TcuProxy);
//
function CreateMultipartFormData: IcuMultipartFormData;
function Get(const AUrl: string): IcuHttpResponse;
function Post(const AURL: string; const ASource: IcuMultipartFormData):
IcuHttpResponse;
property Proxy: TcuProxy read GetProxy write SetProxy;
end;

implementation

{ TcuProxy }

constructor TcuProxy.Create(const AHost: string; APort: Integer; const AUserName,
APassword: string);
begin
FHost := AHost;
FPort := APort;
FUserName := AUserName;
FPassword := APassword;
end;

end.

37 changes: 37 additions & 0 deletions v1.4.4/CrossUrl/Core/CrossUrl.dpk
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package CrossUrl;

{$R *.res}
{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO OFF}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS ON}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION OFF}
{$OVERFLOWCHECKS OFF}
{$RANGECHECKS OFF}
{$REFERENCEINFO ON}
{$SAFEDIVIDE OFF}
{$STACKFRAMES ON}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$DEFINE DEBUG}
{$ENDIF IMPLICITBUILDING}
{$DESCRIPTION 'Cross URL'}
{$IMPLICITBUILD ON}

requires
rtl;

contains
CrossUrl.HttpClient in 'CrossUrl.HttpClient.pas';

end.
Loading

0 comments on commit fc201b3

Please sign in to comment.