Skip to content

Commit

Permalink
feat: Update to Bot API 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Eptagone committed May 29, 2024
1 parent 446fc83 commit 855929c
Show file tree
Hide file tree
Showing 68 changed files with 1,007 additions and 340 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.3](https://img.shields.io/badge/Bot%20API%20version-v7.3-blue?style=flat-square)](https://core.telegram.org/bots/api#march-31-2024)
[![Compatible with Bot API v7.4](https://img.shields.io/badge/Bot%20API%20version-v7.4-blue?style=flat-square)](https://core.telegram.org/bots/api#may-28-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.3 released on May 6, 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.4 released on May 28, 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.3 methods.
- Contains classes for each object type used in the Bot API 7.3.
- Contains pre-defined methods for all Bot API 7.4 methods.
- Contains classes for each object type used in the Bot API 7.4.
- 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.3](https://img.shields.io/badge/Bot%20API%20version-v7.3-blue?style=flat-square)](https://core.telegram.org/bots/api#march-31-2024)
[![Compatible with Bot API v7.4](https://img.shields.io/badge/Bot%20API%20version-v7.4-blue?style=flat-square)](https://core.telegram.org/bots/api#may-28-2024)

## Sample list

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ public CopyMessageArgs(string chatId, string fromChatId, int messageId)
[JsonPropertyName(PropertyNames.CaptionEntities)]
public IEnumerable<MessageEntity>? CaptionEntities { get; set; }

/// <summary>
/// Pass <em>True</em>, if the caption must be shown above the message media. Ignored if a new caption isn't specified.
/// </summary>
[JsonPropertyName(PropertyNames.ShowCaptionAboveMedia)]
public bool? ShowCaptionAboveMedia { get; set; }

/// <summary>
/// Sends the message <a href="https://telegram.org/blog/channels-2-0#silent-messages">silently</a>. Users will receive a notification with no sound.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ public SendAnimationArgs(string chatId, string animation)
[JsonPropertyName(PropertyNames.CaptionEntities)]
public IEnumerable<MessageEntity>? CaptionEntities { get; set; }

/// <summary>
/// Pass <em>True</em>, if the caption must be shown above the message media
/// </summary>
[JsonPropertyName(PropertyNames.ShowCaptionAboveMedia)]
public bool? ShowCaptionAboveMedia { get; set; }

/// <summary>
/// Pass <em>True</em> if the animation needs to be covered with a spoiler animation
/// </summary>
Expand All @@ -139,6 +145,12 @@ public SendAnimationArgs(string chatId, string animation)
[JsonPropertyName(PropertyNames.ProtectContent)]
public bool? ProtectContent { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
[JsonPropertyName(PropertyNames.MessageEffectId)]
public string? MessageEffectId { get; set; }

/// <summary>
/// Description of the message to reply to
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ public SendAudioArgs(string chatId, string audio)
[JsonPropertyName(PropertyNames.ProtectContent)]
public bool? ProtectContent { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
[JsonPropertyName(PropertyNames.MessageEffectId)]
public string? MessageEffectId { get; set; }

/// <summary>
/// Description of the message to reply to
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ public SendContactArgs(string chatId, string phoneNumber, string firstName)
[JsonPropertyName(PropertyNames.ProtectContent)]
public bool? ProtectContent { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
[JsonPropertyName(PropertyNames.MessageEffectId)]
public string? MessageEffectId { get; set; }

/// <summary>
/// Description of the message to reply to
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ public SendDiceArgs(string chatId)
[JsonPropertyName(PropertyNames.ProtectContent)]
public bool? ProtectContent { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
[JsonPropertyName(PropertyNames.MessageEffectId)]
public string? MessageEffectId { get; set; }

/// <summary>
/// Description of the message to reply to
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ public SendDocumentArgs(string chatId, string document)
[JsonPropertyName(PropertyNames.ProtectContent)]
public bool? ProtectContent { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
[JsonPropertyName(PropertyNames.MessageEffectId)]
public string? MessageEffectId { get; set; }

/// <summary>
/// Description of the message to reply to
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ public SendLocationArgs(string chatId, float latitude, float longitude)
[JsonPropertyName(PropertyNames.ProtectContent)]
public bool? ProtectContent { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
[JsonPropertyName(PropertyNames.MessageEffectId)]
public string? MessageEffectId { get; set; }

/// <summary>
/// Description of the message to reply to
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ public SendMediaGroupArgs(string chatId, IEnumerable<InputMediaVideo> media)
[JsonPropertyName(PropertyNames.ProtectContent)]
public bool? ProtectContent { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
[JsonPropertyName(PropertyNames.MessageEffectId)]
public string? MessageEffectId { get; set; }

/// <summary>
/// Description of the message to reply to
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ public SendMessageArgs(string chatId, string text)
[JsonPropertyName(PropertyNames.ProtectContent)]
public bool? ProtectContent { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
[JsonPropertyName(PropertyNames.MessageEffectId)]
public string? MessageEffectId { get; set; }

/// <summary>
/// Description of the message to reply to
/// </summary>
Expand Down
12 changes: 12 additions & 0 deletions src/library/Telegram.BotAPI/AvailableMethods/Args/SendPhotoArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ public SendPhotoArgs(string chatId, string photo)
[JsonPropertyName(PropertyNames.CaptionEntities)]
public IEnumerable<MessageEntity>? CaptionEntities { get; set; }

/// <summary>
/// Pass <em>True</em>, if the caption must be shown above the message media
/// </summary>
[JsonPropertyName(PropertyNames.ShowCaptionAboveMedia)]
public bool? ShowCaptionAboveMedia { get; set; }

/// <summary>
/// Pass <em>True</em> if the photo needs to be covered with a spoiler animation
/// </summary>
Expand All @@ -115,6 +121,12 @@ public SendPhotoArgs(string chatId, string photo)
[JsonPropertyName(PropertyNames.ProtectContent)]
public bool? ProtectContent { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
[JsonPropertyName(PropertyNames.MessageEffectId)]
public string? MessageEffectId { get; set; }

/// <summary>
/// Description of the message to reply to
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ public SendPollArgs(string chatId, string question, IEnumerable<InputPollOption>
[JsonPropertyName(PropertyNames.ProtectContent)]
public bool? ProtectContent { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
[JsonPropertyName(PropertyNames.MessageEffectId)]
public string? MessageEffectId { get; set; }

/// <summary>
/// Description of the message to reply to
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ public SendVenueArgs(string chatId, float latitude, float longitude, string titl
[JsonPropertyName(PropertyNames.ProtectContent)]
public bool? ProtectContent { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
[JsonPropertyName(PropertyNames.MessageEffectId)]
public string? MessageEffectId { get; set; }

/// <summary>
/// Description of the message to reply to
/// </summary>
Expand Down
12 changes: 12 additions & 0 deletions src/library/Telegram.BotAPI/AvailableMethods/Args/SendVideoArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ public SendVideoArgs(string chatId, string video)
[JsonPropertyName(PropertyNames.CaptionEntities)]
public IEnumerable<MessageEntity>? CaptionEntities { get; set; }

/// <summary>
/// Pass <em>True</em>, if the caption must be shown above the message media
/// </summary>
[JsonPropertyName(PropertyNames.ShowCaptionAboveMedia)]
public bool? ShowCaptionAboveMedia { get; set; }

/// <summary>
/// Pass <em>True</em> if the video needs to be covered with a spoiler animation
/// </summary>
Expand All @@ -145,6 +151,12 @@ public SendVideoArgs(string chatId, string video)
[JsonPropertyName(PropertyNames.ProtectContent)]
public bool? ProtectContent { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
[JsonPropertyName(PropertyNames.MessageEffectId)]
public string? MessageEffectId { get; set; }

/// <summary>
/// Description of the message to reply to
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ public SendVideoNoteArgs(string chatId, string videoNote)
[JsonPropertyName(PropertyNames.ProtectContent)]
public bool? ProtectContent { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
[JsonPropertyName(PropertyNames.MessageEffectId)]
public string? MessageEffectId { get; set; }

/// <summary>
/// Description of the message to reply to
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ public SendVoiceArgs(string chatId, string voice)
[JsonPropertyName(PropertyNames.ProtectContent)]
public bool? ProtectContent { get; set; }

/// <summary>
/// Unique identifier of the message effect to be added to the message; for private chats only
/// </summary>
[JsonPropertyName(PropertyNames.MessageEffectId)]
public string? MessageEffectId { get; set; }

/// <summary>
/// Description of the message to reply to
/// </summary>
Expand Down
Loading

0 comments on commit 855929c

Please sign in to comment.