Skip to content

Commit

Permalink
Merge pull request #1398 from TelegramBots/develop
Browse files Browse the repository at this point in the history
Bot API 7.7
  • Loading branch information
wiz0u authored Jul 11, 2024
2 parents 25056be + 790f10e commit 4b0565d
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .azure-pipelines/variables.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variables:
variables:
- group: Integration Tests Variables
- name: versionPrefix
value: 21.5.0
value: 21.6.0
- name: versionSuffix
value: ''
- name: ciVersionSuffix
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# .NET Client for Telegram Bot API
# .NET Client for Telegram Bot API

[![Nuget](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fnuget.voids.site%2Fv3%2Fpackage%2FTelegram.Bot%2Findex.json&query=versions%5B-1%3A%5D&style=flat-square&label=Telegram.Bot&color=d8b541)](https://nuget.voids.site/packages/Telegram.Bot)
[![Bot API Version](https://img.shields.io/badge/Bot%20API-7.6-f36caf.svg?style=flat-square)](https://core.telegram.org/bots/api#july-1-2024)
[![Bot API Version](https://img.shields.io/badge/Bot%20API-7.7-f36caf.svg?style=flat-square)](https://core.telegram.org/bots/api#july-7-2024)
[![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
4 changes: 2 additions & 2 deletions src/Telegram.Bot/Telegram.Bot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.
</Description>
<PackageId>Telegram.Bot</PackageId>
<Authors>RoundRobin,Poulad,tuscen</Authors>
<Copyright>Copyright © Robin Müller 2016</Copyright>
<Authors>RoundRobin,Poulad,tuscen,Wizou</Authors>
<Copyright>Copyright © TelegramBots 2016-2024</Copyright>
<PackageIcon>package-icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageProjectUrl>https://github.com/TelegramBots/telegram.bot</PackageProjectUrl>
Expand Down
2 changes: 2 additions & 0 deletions src/Telegram.Bot/Types/Enums/MessageType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public enum MessageType
ChatBackgroundSet,
/// <summary>The <see cref="Message"/> contains a <see cref="Message.PaidMedia"/></summary>
PaidMedia,
/// <summary>The <see cref="Message"/> contains a <see cref="Message.RefundedPayment"/></summary>
RefundedPayment,

#pragma warning disable CS1591
WebsiteConnected = ConnectedWebsite,
Expand Down
4 changes: 4 additions & 0 deletions src/Telegram.Bot/Types/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ public partial class Message
/// <summary><em>Optional</em>. Message is a service message about a successful payment, information about the payment. <a href="https://core.telegram.org/bots/api#payments">More about payments »</a></summary>
public SuccessfulPayment? SuccessfulPayment { get; set; }

/// <summary><em>Optional</em>. Message is a service message about a refunded payment, information about the payment. <a href="https://core.telegram.org/bots/api#payments">More about payments »</a></summary>
public RefundedPayment? RefundedPayment { get; set; }

/// <summary><em>Optional</em>. Service message: users were shared with the bot</summary>
public UsersShared? UsersShared { get; set; }

Expand Down Expand Up @@ -296,6 +299,7 @@ public partial class Message
{ PinnedMessage: not null } => MessageType.PinnedMessage,
{ Invoice: not null } => MessageType.Invoice,
{ SuccessfulPayment: not null } => MessageType.SuccessfulPayment,
{ RefundedPayment: not null } => MessageType.RefundedPayment,
{ UsersShared: not null } => MessageType.UsersShared,
{ ChatShared: not null } => MessageType.ChatShared,
{ ConnectedWebsite: not null } => MessageType.ConnectedWebsite,
Expand Down
24 changes: 24 additions & 0 deletions src/Telegram.Bot/Types/Payments/RefundedPayment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace Telegram.Bot.Types.Payments;

/// <summary>This object contains basic information about a refunded payment.</summary>
public partial class RefundedPayment
{
/// <summary>Three-letter ISO 4217 <a href="https://core.telegram.org/bots/payments#supported-currencies">currency</a> code, or “XTR” for payments in <a href="https://t.me/BotNews/90">Telegram Stars</a>. Currently, always “XTR”</summary>
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public string Currency { get; set; } = default!;

/// <summary>Total refunded price in the <em>smallest units</em> of the currency (integer, <b>not</b> float/double). For example, for a price of <c>US$ 1.45</c>, <c><see cref="TotalAmount">TotalAmount</see> = 145</c>. See the <em>exp</em> parameter in <a href="https://core.telegram.org/bots/payments/currencies.json">currencies.json</a>, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).</summary>
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public int TotalAmount { get; set; }

/// <summary>Bot-specified invoice payload</summary>
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public string InvoicePayload { get; set; } = default!;

/// <summary>Telegram payment identifier</summary>
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
public string TelegramPaymentChargeId { get; set; } = default!;

/// <summary><em>Optional</em>. Provider payment identifier</summary>
public string? ProviderPaymentChargeId { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Telegram.Bot.Types.Enums;
Expand Down Expand Up @@ -92,8 +92,8 @@ public IEnumerator<object[]> GetEnumerator()
yield return [MessageType.Text, "text"];
yield return [MessageType.Animation, "animation"];
yield return [MessageType.Audio, "audio"];
yield return [MessageType.BoostAdded, "boost_added"];
yield return [MessageType.Document, "document"];
yield return [MessageType.PaidMedia, "paid_media"];
yield return [MessageType.Photo, "photo"];
yield return [MessageType.Sticker, "sticker"];
yield return [MessageType.Story, "story"];
Expand All @@ -120,12 +120,15 @@ public IEnumerator<object[]> GetEnumerator()
yield return [MessageType.PinnedMessage, "pinned_message"];
yield return [MessageType.Invoice, "invoice"];
yield return [MessageType.SuccessfulPayment, "successful_payment"];
yield return [MessageType.RefundedPayment, "refunded_payment"];
yield return [MessageType.UsersShared, "users_shared"];
yield return [MessageType.ChatShared, "chat_shared"];
yield return [MessageType.ConnectedWebsite, "connected_website"];
yield return [MessageType.WriteAccessAllowed, "write_access_allowed"];
yield return [MessageType.PassportData, "passport_data"];
yield return [MessageType.ProximityAlertTriggered, "proximity_alert_triggered"];
yield return [MessageType.BoostAdded, "boost_added"];
yield return [MessageType.ChatBackgroundSet, "chat_background_set"];
yield return [MessageType.ForumTopicCreated, "forum_topic_created"];
yield return [MessageType.ForumTopicEdited, "forum_topic_edited"];
yield return [MessageType.ForumTopicClosed, "forum_topic_closed"];
Expand All @@ -141,8 +144,6 @@ public IEnumerator<object[]> GetEnumerator()
yield return [MessageType.VideoChatEnded, "video_chat_ended"];
yield return [MessageType.VideoChatParticipantsInvited, "video_chat_participants_invited"];
yield return [MessageType.WebAppData, "web_app_data"];
yield return [MessageType.ChatBackgroundSet, "chat_background_set"];
yield return [MessageType.PaidMedia, "paid_media"];
}

IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
Expand Down

0 comments on commit 4b0565d

Please sign in to comment.