-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
115 changed files
with
42,258 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Oops, something went wrong.