Skip to content

Commit

Permalink
Merge pull request #56 from RxTelegram/v7.10
Browse files Browse the repository at this point in the history
V7.10
  • Loading branch information
niklasweimann authored Sep 7, 2024
2 parents 25f6626 + f417f2c commit e9fceb8
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=RxTelegram_RxTelegram.Bot&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=RxTelegram_RxTelegram.Bot)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=RxTelegram_RxTelegram.Bot&metric=coverage)](https://sonarcloud.io/summary/new_code?id=RxTelegram_RxTelegram.Bot)

RxTelegram.Bot supports Telegram Bot API 7.9 (as at August 14, 2024).
RxTelegram.Bot supports Telegram Bot API 7.10 (as at September 6, 2024).

This is a reactive designed .NET Library for the Telegram Bot API. It works with the official [Reactive Extentions](https://github.com/dotnet/reactive).

Expand Down
1 change: 1 addition & 0 deletions src/RxTelegram.Bot/Api/UpdateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ internal void DistributeUpdates(Update[] updates)
var updateStrategies = new List<Action<Update>>
{
update => OnNext(UpdateType.PreCheckoutQuery, update.PreCheckoutQuery),
update => OnNext(UpdateType.PurchasedPaidMedia, update.PurchasedPaidMedia),
update => OnNext(UpdateType.ShippingQuery, update.ShippingQuery),
update => OnNext(UpdateType.EditedChannelPost, update.EditedChannelPost),
update => OnNext(UpdateType.ChannelPost, update.ChannelPost),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public class ChatBoostSourceGiveaway : ChatBoostSource
/// </summary>
public User User { get; set; }

/// <summary>
/// Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
/// </summary>
public int PrizeStarCount { get; set; }

/// <summary>
/// Optional. True, if the giveaway was completed, but there was no user to win the prize
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions src/RxTelegram.Bot/Interface/BaseTypes/Enums/UpdateType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public enum UpdateType

PreCheckoutQuery,

PurchasedPaidMedia,

Poll,

PollAnswer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public class SendPaidMedia : BaseTextRequest
/// </summary>
public List<BaseInputPaidMedia> Media { get; set; }

/// <summary>
/// Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes.
/// </summary>
public string Payload { get; set; }

/// <summary>
/// Media caption, 0-1024 characters after entities parsing
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/RxTelegram.Bot/Interface/Giveaway/Giveaway.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public class Giveaway
/// </summary>
public List<string> CountryCodes { get; set; }

/// <summary>
/// Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
/// </summary>
public int PrizeStarCount { get; set; }

/// <summary>
/// Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/RxTelegram.Bot/Interface/Giveaway/GiveawayCompleted.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ public class GiveawayCompleted
/// Optional. Message with the giveaway that was completed, if it wasn't deleted
/// </summary>
public Message GiveawayMessage { get; set; }

/// <summary>
/// Optional. True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway.
/// </summary>
public bool IsStarGiveaway { get; set; }
}
4 changes: 4 additions & 0 deletions src/RxTelegram.Bot/Interface/Giveaway/GiveawayCreated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ namespace RxTelegram.Bot.Interface.Giveaway;
/// </summary>
public class GiveawayCreated
{
/// <summary>
/// Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
/// </summary>
public int? PrizeStarCount { get; set; }
}
5 changes: 5 additions & 0 deletions src/RxTelegram.Bot/Interface/Giveaway/GiveawayWinners.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public class GiveawayWinners
/// </summary>
public int AdditionalChatCount { get; set; }

/// <summary>
/// Optional. The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only
/// </summary>
public int PrizeStarCount { get; set; }

/// <summary>
/// Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for
/// </summary>
Expand Down
10 changes: 10 additions & 0 deletions src/RxTelegram.Bot/Interface/Payments/PaidMediaPurchased.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using RxTelegram.Bot.Interface.BaseTypes;

namespace RxTelegram.Bot.Interface.Payments;

public class PaidMediaPurchased
{
public User From { get; set; }

public string PaidMediaPayload { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,13 @@ public class TransactionPartnerUser : TransactionPartner
/// </summary>
public string InvoicePayload { get; set; }

/// <summary>
/// Optional. Information about the paid media bought by the user
/// </summary>
public List<PaidMedia> PaidMedia { get; set; }

/// <summary>
/// Optional. Bot-specified paid media payload
/// </summary>
public string PaidMediaPayload { get; set; }
}
5 changes: 5 additions & 0 deletions src/RxTelegram.Bot/Interface/Setup/Update.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ public class Update
/// </summary>
public PreCheckoutQuery PreCheckoutQuery { get; set; }

/// <summary>
/// Optional. A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat
/// </summary>
public PaidMediaPurchased PurchasedPaidMedia { get; set; }

/// <summary>
/// New poll state. Bots receive only updates about polls, which are sent or stopped by the bot
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/RxTelegram.Bot/RxTelegram.Bot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<RepositoryUrl>https://github.com/RxTelegram/RxTelegram.Bot</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Telegram;Bot;Api;Rx;Reactive;Observable;RxTelegram;RxTelegram.Bot</PackageTags>
<PackageVersion>7.9.0</PackageVersion>
<PackageVersion>7.10.0</PackageVersion>
<PackageIcon>icon.png</PackageIcon>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
Expand Down

0 comments on commit e9fceb8

Please sign in to comment.