Skip to content

Commit

Permalink
feat: Update to Bot API 7.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Eptagone committed Jul 7, 2024
1 parent 53786c2 commit b84b4c4
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
| -------------------------------------------------- | -------------------------------- |

[![NuGet version (Telegram.BotAPI)](https://img.shields.io/nuget/v/Telegram.BotAPI?style=flat-square&logo=nuget)](https://www.nuget.org/packages/Telegram.BotAPI/)
[![Compatible with Bot API v7.6](https://img.shields.io/badge/Bot%20API%20version-v7.6-blue?style=flat-square)](https://core.telegram.org/bots/api#july-1-2024)
[![Compatible with Bot API v7.7](https://img.shields.io/badge/Bot%20API%20version-v7.7-blue?style=flat-square)](https://core.telegram.org/bots/api#july-7-2024)

**Telegram.BotAPI** is one of the most complete libraries available to interact with the Telegram Bot API in your .NET projects. It contains all the methods and types available in the Bot API 7.6 released on July 1, 2024.
**Telegram.BotAPI** is one of the most complete libraries available to interact with the Telegram Bot API in your .NET projects. It contains all the methods and types available in the Bot API 7.7 released on July 7, 2024.

[![Telegram Chat](https://img.shields.io/badge/Telegram.BotAPI%20--%20Chat-Join-blue?style=social&logo=telegram)](https://t.me/TBAPINET)

---

## Features

- Contains pre-defined methods for all Bot API 7.6 methods.
- Contains classes for each object type used in the Bot API 7.6.
- Contains pre-defined methods for all Bot API 7.7 methods.
- Contains classes for each object type used in the Bot API 7.7.
- Sync and async methods.
- Uses [System.Text.Json](https://www.nuget.org/packages/System.Text.Json/).

Expand Down
2 changes: 1 addition & 1 deletion src/examples/readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Telegram.BotAPI NET Examples

[![NuGet version (Telegram.BotAPI)](https://img.shields.io/nuget/v/Telegram.BotAPI?style=flat-square&logo=nuget)](https://www.nuget.org/packages/Telegram.BotAPI/)
[![Compatible with Bot API v7.6](https://img.shields.io/badge/Bot%20API%20version-v7.6-blue?style=flat-square)](https://core.telegram.org/bots/api#july-1-2024)
[![Compatible with Bot API v7.7](https://img.shields.io/badge/Bot%20API%20version-v7.7-blue?style=flat-square)](https://core.telegram.org/bots/api#july-7-2024)

## Sample list

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,12 @@ public class Message : MaybeInaccessibleMessage
[JsonPropertyName(PropertyNames.SuccessfulPayment)]
public SuccessfulPayment? SuccessfulPayment { get; set; }

/// <summary>
/// Optional. 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>
[JsonPropertyName(PropertyNames.RefundedPayment)]
public RefundedPayment? RefundedPayment { get; set; }

/// <summary>
/// Optional. Service message: users were shared with the bot
/// </summary>
Expand Down
41 changes: 41 additions & 0 deletions src/library/Telegram.BotAPI/Payments/RefundedPayment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (c) 2024 Quetzal Rivera.
// Licensed under the MIT License, See LICENCE in the project root for license information.
//* This file is auto-generated. Don't edit it manually!

namespace Telegram.BotAPI.Payments;

/// <summary>
/// This object contains basic information about a refunded payment.
/// </summary>
public 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>
[JsonPropertyName(PropertyNames.Currency)]
public string Currency { get; set; } = null!;

/// <summary>
/// Total refunded price in the <em>smallest units</em> of the currency (integer, <strong>not</strong> float/double). For example, for a price of <em>US$ 1.45</em>, <em>total_amount = 145</em>. 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>
[JsonPropertyName(PropertyNames.TotalAmount)]
public int TotalAmount { get; set; }

/// <summary>
/// Bot-specified invoice payload
/// </summary>
[JsonPropertyName(PropertyNames.InvoicePayload)]
public string InvoicePayload { get; set; } = null!;

/// <summary>
/// Telegram payment identifier
/// </summary>
[JsonPropertyName(PropertyNames.TelegramPaymentChargeId)]
public string TelegramPaymentChargeId { get; set; } = null!;

/// <summary>
/// Optional. Provider payment identifier
/// </summary>
[JsonPropertyName(PropertyNames.ProviderPaymentChargeId)]
public string? ProviderPaymentChargeId { get; set; }
}
1 change: 1 addition & 0 deletions src/library/Telegram.BotAPI/PropertyNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ public static partial class PropertyNames
public const string Reaction = "reaction";
public const string Reactions = "reactions";
public const string Receiver = "receiver";
public const string RefundedPayment = "refunded_payment";
public const string RemoveCaption = "remove_caption";
public const string RemoveDate = "remove_date";
public const string RemoveKeyboard = "remove_keyboard";
Expand Down
8 changes: 4 additions & 4 deletions src/library/Telegram.BotAPI/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Telegram.BotAPI

[![Compatible with Bot API v7.6](https://img.shields.io/badge/Bot%20API%20version-v7.6-blue?style=flat-square)](https://core.telegram.org/bots/api#july-1-2024)
[![Compatible with Bot API v7.7](https://img.shields.io/badge/Bot%20API%20version-v7.7-blue?style=flat-square)](https://core.telegram.org/bots/api#july-7-2024)

**Telegram.BotAPI** is one of the most complete libraries available to interact with the Telegram Bot API in your .NET projects. Free and open source.

It contains all the methods and types available in the Bot API 7.6 released on July 1, 2024.
It contains all the methods and types available in the Bot API 7.7 released on July 7, 2024.

---

## Features

- Contains pre-defined methods for all Bot API 7.6 methods.
- Contains classes for each object type used in the Bot API 7.6.
- Contains pre-defined methods for all Bot API 7.7 methods.
- Contains classes for each object type used in the Bot API 7.7.
- Sync and async methods.
- Uses [System.Text.Json](https://www.nuget.org/packages/System.Text.Json/).

Expand Down
6 changes: 3 additions & 3 deletions src/library/Telegram.BotAPI/Telegram.BotAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>7.6</Version>
<Version>7.7</Version>
<PackageId>$(AssemblyName)</PackageId>
<Authors>Quetzal Rivera</Authors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RootNamespace>Telegram.BotAPI</RootNamespace>
<Copyright>Quetzal Rivera 2024 ©</Copyright>
<NeutralLanguage>en</NeutralLanguage>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Description>A very complete library to use Telegram Bot API in your NET project. Full support for Bot API v7.6 (July 1, 2024).
<Description>A very complete library to use Telegram Bot API in your NET project. Full support for Bot API v7.7 (July 7, 2024).
- Contains all classes and methods available from the Bot API.
</Description>
<PackageTags>Telegram;Bot;API</PackageTags>
Expand All @@ -25,7 +25,7 @@
<PackageProjectUrl>https://github.com/Eptagone/Telegram.BotAPI</PackageProjectUrl>
<RepositoryType></RepositoryType>
<AssemblyName>Telegram.BotAPI</AssemblyName>
<PackageReleaseNotes>Updated to Bot API 7.6</PackageReleaseNotes>
<PackageReleaseNotes>Updated to Bot API 7.7</PackageReleaseNotes>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisLevel>latest-recommended</AnalysisLevel>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down

0 comments on commit b84b4c4

Please sign in to comment.