Skip to content

Commit

Permalink
Merge pull request #1447 from TelegramBots/develop
Browse files Browse the repository at this point in the history
Bot API 8.1, Support for NativeAOT/Blazor/Trimming
  • Loading branch information
wiz0u authored Dec 4, 2024
2 parents 589509a + 29db3d6 commit ec9afd5
Show file tree
Hide file tree
Showing 12 changed files with 328 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/variables.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variables:
- group: Integration Tests Variables
- name: versionPrefix
value: 22.1.3
value: 22.2.0
- name: versionSuffix
value: ''
- name: ciVersionSuffix
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# .NET Client for Telegram Bot API

[![Nuget](https://img.shields.io/nuget/vpre/Telegram.Bot.svg?label=Telegram.Bot&style=flat-square&color=d8b541)](https://www.nuget.org/packages/Telegram.Bot)
[![Bot API Version](https://img.shields.io/badge/Bot_API-8.0-f36caf.svg?style=flat-square)](https://core.telegram.org/bots/api)
[![Bot API Version](https://img.shields.io/badge/Bot_API-8.1-f36caf.svg?style=flat-square)](https://core.telegram.org/bots/api)
[![Documentations](https://img.shields.io/badge/Documentations-Book-orange.svg?style=flat-square)](https://telegrambots.github.io/book/)
[![Telegram Chat](https://img.shields.io/badge/Support_Chat-Telegram-blue.svg?style=flat-square)](https://t.me/joinchat/B35YY0QbLfd034CFnvCtCA)
[![Master build](https://img.shields.io/azure-devops/build/tgbots/14f9ab3f-313a-4339-8534-e8b96c7763cc/6?style=flat-square&label=master)](https://dev.azure.com/tgbots/Telegram.Bot/_build/latest?definitionId=6&branchName=master)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public partial class CreateInvoiceLinkRequest() : RequestBase<string>("createInv
/// <summary>Pass <see langword="true"/> if the final price depends on the shipping method. Ignored for payments in <a href="https://t.me/BotNews/90">Telegram Stars</a>.</summary>
public bool IsFlexible { get; set; }

/// <summary>The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user.</summary>
/// <summary>The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.</summary>
public int? SubscriptionPeriod { get; set; }

/// <summary>Unique identifier of the business connection on behalf of which the link will be created. For payments in <a href="https://t.me/BotNews/90">Telegram Stars</a> only.</summary>
Expand Down
3 changes: 3 additions & 0 deletions src/Telegram.Bot/Serialization/JsonBotAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public static void Configure(JsonSerializerOptions options)
{
options.PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower;
options.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault;
#if NET6_0_OR_GREATER
if (!JsonSerializer.IsReflectionEnabledByDefault) options.TypeInfoResolverChain.Add(JsonBotSerializerContext.Default);
#endif
//when System.Text.Json 9.0 is available, we can use
//options.AllowOutOfOrderMetadataProperties = true; // so we don't need custom PolymorphicJsonConverterFactory
}
Expand Down
271 changes: 271 additions & 0 deletions src/Telegram.Bot/Serialization/JsonBotSerializerContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
#if NET6_0_OR_GREATER
using Telegram.Bot.Requests;

namespace Telegram.Bot;

/// <summary>JsonSerializerContext for Bot API serialization with source generation</summary>
[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.SnakeCaseLower, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault)][JsonSerializable(typeof(GetUpdatesRequest))]
[JsonSerializable(typeof(SetWebhookRequest))]
[JsonSerializable(typeof(DeleteWebhookRequest))]
[JsonSerializable(typeof(GetWebhookInfoRequest))]
[JsonSerializable(typeof(GetMeRequest))]
[JsonSerializable(typeof(LogOutRequest))]
[JsonSerializable(typeof(CloseRequest))]
[JsonSerializable(typeof(SendMessageRequest))]
[JsonSerializable(typeof(ForwardMessageRequest))]
[JsonSerializable(typeof(ForwardMessagesRequest))]
[JsonSerializable(typeof(CopyMessageRequest))]
[JsonSerializable(typeof(CopyMessagesRequest))]
[JsonSerializable(typeof(SendPhotoRequest))]
[JsonSerializable(typeof(SendAudioRequest))]
[JsonSerializable(typeof(SendDocumentRequest))]
[JsonSerializable(typeof(SendVideoRequest))]
[JsonSerializable(typeof(SendAnimationRequest))]
[JsonSerializable(typeof(SendVoiceRequest))]
[JsonSerializable(typeof(SendVideoNoteRequest))]
[JsonSerializable(typeof(SendPaidMediaRequest))]
[JsonSerializable(typeof(SendMediaGroupRequest))]
[JsonSerializable(typeof(SendLocationRequest))]
[JsonSerializable(typeof(SendVenueRequest))]
[JsonSerializable(typeof(SendContactRequest))]
[JsonSerializable(typeof(SendPollRequest))]
[JsonSerializable(typeof(SendDiceRequest))]
[JsonSerializable(typeof(SendChatActionRequest))]
[JsonSerializable(typeof(SetMessageReactionRequest))]
[JsonSerializable(typeof(GetUserProfilePhotosRequest))]
[JsonSerializable(typeof(SetUserEmojiStatusRequest))]
[JsonSerializable(typeof(GetFileRequest))]
[JsonSerializable(typeof(BanChatMemberRequest))]
[JsonSerializable(typeof(UnbanChatMemberRequest))]
[JsonSerializable(typeof(RestrictChatMemberRequest))]
[JsonSerializable(typeof(PromoteChatMemberRequest))]
[JsonSerializable(typeof(SetChatAdministratorCustomTitleRequest))]
[JsonSerializable(typeof(BanChatSenderChatRequest))]
[JsonSerializable(typeof(UnbanChatSenderChatRequest))]
[JsonSerializable(typeof(SetChatPermissionsRequest))]
[JsonSerializable(typeof(ExportChatInviteLinkRequest))]
[JsonSerializable(typeof(CreateChatInviteLinkRequest))]
[JsonSerializable(typeof(EditChatInviteLinkRequest))]
[JsonSerializable(typeof(CreateChatSubscriptionInviteLinkRequest))]
[JsonSerializable(typeof(EditChatSubscriptionInviteLinkRequest))]
[JsonSerializable(typeof(RevokeChatInviteLinkRequest))]
[JsonSerializable(typeof(ApproveChatJoinRequest))]
[JsonSerializable(typeof(DeclineChatJoinRequest))]
[JsonSerializable(typeof(SetChatPhotoRequest))]
[JsonSerializable(typeof(DeleteChatPhotoRequest))]
[JsonSerializable(typeof(SetChatTitleRequest))]
[JsonSerializable(typeof(SetChatDescriptionRequest))]
[JsonSerializable(typeof(PinChatMessageRequest))]
[JsonSerializable(typeof(UnpinChatMessageRequest))]
[JsonSerializable(typeof(UnpinAllChatMessagesRequest))]
[JsonSerializable(typeof(LeaveChatRequest))]
[JsonSerializable(typeof(GetChatRequest))]
[JsonSerializable(typeof(GetChatAdministratorsRequest))]
[JsonSerializable(typeof(GetChatMemberCountRequest))]
[JsonSerializable(typeof(GetChatMemberRequest))]
[JsonSerializable(typeof(SetChatStickerSetRequest))]
[JsonSerializable(typeof(DeleteChatStickerSetRequest))]
[JsonSerializable(typeof(GetForumTopicIconStickersRequest))]
[JsonSerializable(typeof(CreateForumTopicRequest))]
[JsonSerializable(typeof(EditForumTopicRequest))]
[JsonSerializable(typeof(CloseForumTopicRequest))]
[JsonSerializable(typeof(ReopenForumTopicRequest))]
[JsonSerializable(typeof(DeleteForumTopicRequest))]
[JsonSerializable(typeof(UnpinAllForumTopicMessagesRequest))]
[JsonSerializable(typeof(EditGeneralForumTopicRequest))]
[JsonSerializable(typeof(CloseGeneralForumTopicRequest))]
[JsonSerializable(typeof(ReopenGeneralForumTopicRequest))]
[JsonSerializable(typeof(HideGeneralForumTopicRequest))]
[JsonSerializable(typeof(UnhideGeneralForumTopicRequest))]
[JsonSerializable(typeof(UnpinAllGeneralForumTopicMessagesRequest))]
[JsonSerializable(typeof(AnswerCallbackQueryRequest))]
[JsonSerializable(typeof(GetUserChatBoostsRequest))]
[JsonSerializable(typeof(GetBusinessConnectionRequest))]
[JsonSerializable(typeof(SetMyCommandsRequest))]
[JsonSerializable(typeof(DeleteMyCommandsRequest))]
[JsonSerializable(typeof(GetMyCommandsRequest))]
[JsonSerializable(typeof(SetMyNameRequest))]
[JsonSerializable(typeof(GetMyNameRequest))]
[JsonSerializable(typeof(SetMyDescriptionRequest))]
[JsonSerializable(typeof(GetMyDescriptionRequest))]
[JsonSerializable(typeof(SetMyShortDescriptionRequest))]
[JsonSerializable(typeof(GetMyShortDescriptionRequest))]
[JsonSerializable(typeof(SetChatMenuButtonRequest))]
[JsonSerializable(typeof(GetChatMenuButtonRequest))]
[JsonSerializable(typeof(SetMyDefaultAdministratorRightsRequest))]
[JsonSerializable(typeof(GetMyDefaultAdministratorRightsRequest))]
[JsonSerializable(typeof(EditMessageTextRequest))]
[JsonSerializable(typeof(EditInlineMessageTextRequest))]
[JsonSerializable(typeof(EditMessageCaptionRequest))]
[JsonSerializable(typeof(EditInlineMessageCaptionRequest))]
[JsonSerializable(typeof(EditMessageMediaRequest))]
[JsonSerializable(typeof(EditInlineMessageMediaRequest))]
[JsonSerializable(typeof(EditMessageLiveLocationRequest))]
[JsonSerializable(typeof(EditInlineMessageLiveLocationRequest))]
[JsonSerializable(typeof(StopMessageLiveLocationRequest))]
[JsonSerializable(typeof(StopInlineMessageLiveLocationRequest))]
[JsonSerializable(typeof(EditMessageReplyMarkupRequest))]
[JsonSerializable(typeof(EditInlineMessageReplyMarkupRequest))]
[JsonSerializable(typeof(StopPollRequest))]
[JsonSerializable(typeof(DeleteMessageRequest))]
[JsonSerializable(typeof(DeleteMessagesRequest))]
[JsonSerializable(typeof(SendStickerRequest))]
[JsonSerializable(typeof(GetStickerSetRequest))]
[JsonSerializable(typeof(GetCustomEmojiStickersRequest))]
[JsonSerializable(typeof(UploadStickerFileRequest))]
[JsonSerializable(typeof(CreateNewStickerSetRequest))]
[JsonSerializable(typeof(AddStickerToSetRequest))]
[JsonSerializable(typeof(SetStickerPositionInSetRequest))]
[JsonSerializable(typeof(DeleteStickerFromSetRequest))]
[JsonSerializable(typeof(ReplaceStickerInSetRequest))]
[JsonSerializable(typeof(SetStickerEmojiListRequest))]
[JsonSerializable(typeof(SetStickerKeywordsRequest))]
[JsonSerializable(typeof(SetStickerMaskPositionRequest))]
[JsonSerializable(typeof(SetStickerSetTitleRequest))]
[JsonSerializable(typeof(SetStickerSetThumbnailRequest))]
[JsonSerializable(typeof(SetCustomEmojiStickerSetThumbnailRequest))]
[JsonSerializable(typeof(DeleteStickerSetRequest))]
[JsonSerializable(typeof(GetAvailableGiftsRequest))]
[JsonSerializable(typeof(SendGiftRequest))]
[JsonSerializable(typeof(AnswerInlineQueryRequest))]
[JsonSerializable(typeof(AnswerWebAppQueryRequest))]
[JsonSerializable(typeof(SavePreparedInlineMessageRequest))]
[JsonSerializable(typeof(SendInvoiceRequest))]
[JsonSerializable(typeof(CreateInvoiceLinkRequest))]
[JsonSerializable(typeof(AnswerShippingQueryRequest))]
[JsonSerializable(typeof(AnswerPreCheckoutQueryRequest))]
[JsonSerializable(typeof(GetStarTransactionsRequest))]
[JsonSerializable(typeof(RefundStarPaymentRequest))]
[JsonSerializable(typeof(EditUserStarSubscriptionRequest))]
[JsonSerializable(typeof(SetPassportDataErrorsRequest))]
[JsonSerializable(typeof(SendGameRequest))]
[JsonSerializable(typeof(SetGameScoreRequest))]
[JsonSerializable(typeof(SetInlineGameScoreRequest))]
[JsonSerializable(typeof(GetGameHighScoresRequest))]
[JsonSerializable(typeof(GetInlineGameHighScoresRequest))]
[JsonSerializable(typeof(ApiResponse<Update[]>))]
[JsonSerializable(typeof(ApiResponse<bool>))]
[JsonSerializable(typeof(ApiResponse<WebhookInfo>))]
[JsonSerializable(typeof(ApiResponse<User>))]
[JsonSerializable(typeof(ApiResponse<Message>))]
[JsonSerializable(typeof(ApiResponse<MessageId[]>))]
[JsonSerializable(typeof(ApiResponse<MessageId>))]
[JsonSerializable(typeof(ApiResponse<Message[]>))]
[JsonSerializable(typeof(ApiResponse<UserProfilePhotos>))]
[JsonSerializable(typeof(ApiResponse<File>))]
[JsonSerializable(typeof(ApiResponse<string>))]
[JsonSerializable(typeof(ApiResponse<ChatInviteLink>))]
[JsonSerializable(typeof(ApiResponse<ChatFullInfo>))]
[JsonSerializable(typeof(ApiResponse<ChatMember[]>))]
[JsonSerializable(typeof(ApiResponse<int>))]
[JsonSerializable(typeof(ApiResponse<ChatMember>))]
[JsonSerializable(typeof(ApiResponse<Sticker[]>))]
[JsonSerializable(typeof(ApiResponse<ForumTopic>))]
[JsonSerializable(typeof(ApiResponse<UserChatBoosts>))]
[JsonSerializable(typeof(ApiResponse<BusinessConnection>))]
[JsonSerializable(typeof(ApiResponse<BotCommand[]>))]
[JsonSerializable(typeof(ApiResponse<BotName>))]
[JsonSerializable(typeof(ApiResponse<BotDescription>))]
[JsonSerializable(typeof(ApiResponse<BotShortDescription>))]
[JsonSerializable(typeof(ApiResponse<MenuButton>))]
[JsonSerializable(typeof(ApiResponse<ChatAdministratorRights>))]
[JsonSerializable(typeof(ApiResponse<Poll>))]
[JsonSerializable(typeof(ApiResponse<StickerSet>))]
[JsonSerializable(typeof(ApiResponse<GiftList>))]
[JsonSerializable(typeof(ApiResponse<SentWebAppMessage>))]
[JsonSerializable(typeof(ApiResponse<PreparedInlineMessage>))]
[JsonSerializable(typeof(ApiResponse<StarTransactions>))]
[JsonSerializable(typeof(ApiResponse<GameHighScore[]>))]
[JsonSerializable(typeof(MessageOriginUser))]
[JsonSerializable(typeof(MessageOriginHiddenUser))]
[JsonSerializable(typeof(MessageOriginChat))]
[JsonSerializable(typeof(MessageOriginChannel))]
[JsonSerializable(typeof(PaidMediaPreview))]
[JsonSerializable(typeof(PaidMediaPhoto))]
[JsonSerializable(typeof(PaidMediaVideo))]
[JsonSerializable(typeof(BackgroundFillSolid))]
[JsonSerializable(typeof(BackgroundFillGradient))]
[JsonSerializable(typeof(BackgroundFillFreeformGradient))]
[JsonSerializable(typeof(BackgroundTypeFill))]
[JsonSerializable(typeof(BackgroundTypeWallpaper))]
[JsonSerializable(typeof(BackgroundTypePattern))]
[JsonSerializable(typeof(BackgroundTypeChatTheme))]
[JsonSerializable(typeof(ReplyKeyboardMarkup))]
[JsonSerializable(typeof(ReplyKeyboardRemove))]
[JsonSerializable(typeof(ForceReplyMarkup))]
[JsonSerializable(typeof(ChatMemberOwner))]
[JsonSerializable(typeof(ChatMemberAdministrator))]
[JsonSerializable(typeof(ChatMemberMember))]
[JsonSerializable(typeof(ChatMemberRestricted))]
[JsonSerializable(typeof(ChatMemberLeft))]
[JsonSerializable(typeof(ChatMemberBanned))]
[JsonSerializable(typeof(ReactionTypeEmoji))]
[JsonSerializable(typeof(ReactionTypeCustomEmoji))]
[JsonSerializable(typeof(ReactionTypePaid))]
[JsonSerializable(typeof(BotCommandScopeDefault))]
[JsonSerializable(typeof(BotCommandScopeAllPrivateChats))]
[JsonSerializable(typeof(BotCommandScopeAllGroupChats))]
[JsonSerializable(typeof(BotCommandScopeAllChatAdministrators))]
[JsonSerializable(typeof(BotCommandScopeChat))]
[JsonSerializable(typeof(BotCommandScopeChatAdministrators))]
[JsonSerializable(typeof(BotCommandScopeChatMember))]
[JsonSerializable(typeof(MenuButtonCommands))]
[JsonSerializable(typeof(MenuButtonWebApp))]
[JsonSerializable(typeof(MenuButtonDefault))]
[JsonSerializable(typeof(ChatBoostSourcePremium))]
[JsonSerializable(typeof(ChatBoostSourceGiftCode))]
[JsonSerializable(typeof(ChatBoostSourceGiveaway))]
[JsonSerializable(typeof(ResponseParameters))]
[JsonSerializable(typeof(InputMediaPhoto))]
[JsonSerializable(typeof(InputMediaVideo))]
[JsonSerializable(typeof(InputMediaAnimation))]
[JsonSerializable(typeof(InputMediaAudio))]
[JsonSerializable(typeof(InputMediaDocument))]
[JsonSerializable(typeof(InputPaidMediaPhoto))]
[JsonSerializable(typeof(InputPaidMediaVideo))]
[JsonSerializable(typeof(InlineQueryResultArticle))]
[JsonSerializable(typeof(InlineQueryResultPhoto))]
[JsonSerializable(typeof(InlineQueryResultGif))]
[JsonSerializable(typeof(InlineQueryResultMpeg4Gif))]
[JsonSerializable(typeof(InlineQueryResultVideo))]
[JsonSerializable(typeof(InlineQueryResultAudio))]
[JsonSerializable(typeof(InlineQueryResultVoice))]
[JsonSerializable(typeof(InlineQueryResultDocument))]
[JsonSerializable(typeof(InlineQueryResultLocation))]
[JsonSerializable(typeof(InlineQueryResultVenue))]
[JsonSerializable(typeof(InlineQueryResultContact))]
[JsonSerializable(typeof(InlineQueryResultGame))]
[JsonSerializable(typeof(InlineQueryResultCachedPhoto))]
[JsonSerializable(typeof(InlineQueryResultCachedGif))]
[JsonSerializable(typeof(InlineQueryResultCachedMpeg4Gif))]
[JsonSerializable(typeof(InlineQueryResultCachedSticker))]
[JsonSerializable(typeof(InlineQueryResultCachedDocument))]
[JsonSerializable(typeof(InlineQueryResultCachedVideo))]
[JsonSerializable(typeof(InlineQueryResultCachedVoice))]
[JsonSerializable(typeof(InlineQueryResultCachedAudio))]
[JsonSerializable(typeof(InputTextMessageContent))]
[JsonSerializable(typeof(InputLocationMessageContent))]
[JsonSerializable(typeof(InputVenueMessageContent))]
[JsonSerializable(typeof(InputContactMessageContent))]
[JsonSerializable(typeof(InputInvoiceMessageContent))]
[JsonSerializable(typeof(RevenueWithdrawalStatePending))]
[JsonSerializable(typeof(RevenueWithdrawalStateSucceeded))]
[JsonSerializable(typeof(RevenueWithdrawalStateFailed))]
[JsonSerializable(typeof(TransactionPartnerUser))]
[JsonSerializable(typeof(TransactionPartnerAffiliateProgram))]
[JsonSerializable(typeof(TransactionPartnerFragment))]
[JsonSerializable(typeof(TransactionPartnerTelegramAds))]
[JsonSerializable(typeof(TransactionPartnerTelegramApi))]
[JsonSerializable(typeof(TransactionPartnerOther))]
[JsonSerializable(typeof(PassportElementErrorDataField))]
[JsonSerializable(typeof(PassportElementErrorFrontSide))]
[JsonSerializable(typeof(PassportElementErrorReverseSide))]
[JsonSerializable(typeof(PassportElementErrorSelfie))]
[JsonSerializable(typeof(PassportElementErrorFile))]
[JsonSerializable(typeof(PassportElementErrorFiles))]
[JsonSerializable(typeof(PassportElementErrorTranslationFile))]
[JsonSerializable(typeof(PassportElementErrorTranslationFiles))]
[JsonSerializable(typeof(PassportElementErrorUnspecified))]
[JsonSerializable(typeof(FileBase))]
public partial class JsonBotSerializerContext : JsonSerializerContext;
#endif
1 change: 1 addition & 0 deletions src/Telegram.Bot/Telegram.Bot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<NoWarn>$(NoWarn);MA0001;MA0048;MA0051;MA0111;MA0113</NoWarn>
<NoWarn>$(NoWarn);IDE0079;IDE0130</NoWarn>
<NoWarn>$(NoWarn);CS0419</NoWarn> <!-- Ambiguous reference in cref attribute -->
<NoWarn>$(NoWarn);IL2026</NoWarn> <!-- Using member 'method' which has 'RequiresUnreferencedCodeAttribute'... it's ok we use JsonSerializerOptions with type resolver context -->
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/Telegram.Bot/TelegramBotClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
using System.Net.Http.Json;
#endif

#pragma warning disable CA1001 // _receivingEvents isn't used with timer or WaitHandle, so needn't be disposed

namespace Telegram.Bot;

/// <summary>A client to use the Telegram Bot API</summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram.Bot/TelegramBotClientExtensions.ApiMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4688,7 +4688,7 @@ public static Task<Message> SendInvoiceAsync(
/// <param name="sendPhoneNumberToProvider">Pass <see langword="true"/> if the user's phone number should be sent to the provider. Ignored for payments in <a href="https://t.me/BotNews/90">Telegram Stars</a>.</param>
/// <param name="sendEmailToProvider">Pass <see langword="true"/> if the user's email address should be sent to the provider. Ignored for payments in <a href="https://t.me/BotNews/90">Telegram Stars</a>.</param>
/// <param name="isFlexible">Pass <see langword="true"/> if the final price depends on the shipping method. Ignored for payments in <a href="https://t.me/BotNews/90">Telegram Stars</a>.</param>
/// <param name="subscriptionPeriod">The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user.</param>
/// <param name="subscriptionPeriod">The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.</param>
/// <param name="businessConnectionId">Unique identifier of the business connection on behalf of which the link will be created. For payments in <a href="https://t.me/BotNews/90">Telegram Stars</a> only.</param>
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation</param>
/// <returns>The created invoice link as <em>String</em> on success.</returns>
Expand Down
Loading

0 comments on commit ec9afd5

Please sign in to comment.