Skip to content

Commit 3cc4077

Browse files
committed
feat: Update to Bot API 8.2
1 parent c45240d commit 3cc4077

23 files changed

+330
-40
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
| -------------------------------------------------- | -------------------------------- |
33

44
[![NuGet version (Telegram.BotAPI)](https://img.shields.io/nuget/v/Telegram.BotAPI?style=flat-square&logo=nuget)](https://www.nuget.org/packages/Telegram.BotAPI/)
5-
[![Compatible with Bot API v8.1](https://img.shields.io/badge/Bot%20API%20version-v8.1-blue?style=flat-square)](https://core.telegram.org/bots/api#december-4-2024)
5+
[![Compatible with Bot API v8.2](https://img.shields.io/badge/Bot%20API%20version-v8.2-blue?style=flat-square)](https://core.telegram.org/bots/api#january-1-2025)
66

7-
**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 8.1 released on December 4, 2024.
7+
**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 8.2 released on January 1, 2025.
88

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

1111
---
1212

1313
## Features
1414

15-
- Contains pre-defined methods for all Bot API 8.1 methods.
16-
- Contains classes for each object type used in the Bot API 8.1.
15+
- Contains pre-defined methods for all Bot API 8.2 methods.
16+
- Contains classes for each object type used in the Bot API 8.2.
1717
- Sync and async methods.
1818
- Uses [System.Text.Json](https://www.nuget.org/packages/System.Text.Json/).
1919

src/examples/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Telegram.BotAPI NET Examples
22

33
[![NuGet version (Telegram.BotAPI)](https://img.shields.io/nuget/v/Telegram.BotAPI?style=flat-square&logo=nuget)](https://www.nuget.org/packages/Telegram.BotAPI/)
4-
[![Compatible with Bot API v8.1](https://img.shields.io/badge/Bot%20API%20version-v8.1-blue?style=flat-square)](https://core.telegram.org/bots/api#december-4-2024)
4+
[![Compatible with Bot API v8.2](https://img.shields.io/badge/Bot%20API%20version-v8.2-blue?style=flat-square)](https://core.telegram.org/bots/api#january-1-2025)
55

66
## Sample list
77

src/library/Telegram.BotAPI/AvailableTypes/BackgroundType/BackgroundTypePattern.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Telegram.BotAPI.AvailableTypes;
66

77
/// <summary>
8-
/// The background is a PNG or TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.
8+
/// The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.
99
/// </summary>
1010
public class BackgroundTypePattern : BackgroundType
1111
{

src/library/Telegram.BotAPI/GettingUpdates/Args/GetUpdatesArgs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class GetUpdatesArgs
2828
public int? Timeout { get; set; }
2929

3030
/// <summary>
31-
/// A JSON-serialized list of the update types you want your bot to receive. For example, specify <em>["message", "edited_channel_post", "callback_query"]</em> to only receive updates of these types. See <see cref="Update"/> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em>, <em>message_reaction</em>, and <em>message_reaction_count</em> (default). If not specified, the previous setting will be used.<br /><br />Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.
31+
/// A JSON-serialized list of the update types you want your bot to receive. For example, specify <em>["message", "edited_channel_post", "callback_query"]</em> to only receive updates of these types. See <see cref="Update"/> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em>, <em>message_reaction</em>, and <em>message_reaction_count</em> (default). If not specified, the previous setting will be used.<br /><br />Please note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time.
3232
/// </summary>
3333
[JsonPropertyName(PropertyNames.AllowedUpdates)]
3434
public IEnumerable<string>? AllowedUpdates { get; set; }

src/library/Telegram.BotAPI/GettingUpdates/getUpdates.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static Task<IEnumerable<Update>> GetUpdatesAsync(this ITelegramBotClient
4646
/// <param name="offset">Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as <a href="https://core.telegram.org/bots/api#getupdates">getUpdates</a> is called with an <em>offset</em> higher than its <em>update_id</em>. The negative offset can be specified to retrieve updates starting from <em>-offset</em> update from the end of the updates queue. All previous updates will be forgotten.</param>
4747
/// <param name="limit">Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.</param>
4848
/// <param name="timeout">Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.</param>
49-
/// <param name="allowedUpdates">A JSON-serialized list of the update types you want your bot to receive. For example, specify <em>["message", "edited_channel_post", "callback_query"]</em> to only receive updates of these types. See <see cref="Update"/> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em>, <em>message_reaction</em>, and <em>message_reaction_count</em> (default). If not specified, the previous setting will be used.<br /><br />Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.</param>
49+
/// <param name="allowedUpdates">A JSON-serialized list of the update types you want your bot to receive. For example, specify <em>["message", "edited_channel_post", "callback_query"]</em> to only receive updates of these types. See <see cref="Update"/> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em>, <em>message_reaction</em>, and <em>message_reaction_count</em> (default). If not specified, the previous setting will be used.<br /><br />Please note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time.</param>
5050
/// <exception cref="ArgumentNullException">Thrown if <paramref name="client"/> is <c>null</c>.</exception>
5151
/// <exception cref="BotRequestException">Thrown if the request to the Telegram Bot API fails.</exception>
5252
/// <returns></returns>
@@ -60,7 +60,7 @@ public static IEnumerable<Update> GetUpdates(this ITelegramBotClient client, int
6060
/// <param name="offset">Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as <a href="https://core.telegram.org/bots/api#getupdates">getUpdates</a> is called with an <em>offset</em> higher than its <em>update_id</em>. The negative offset can be specified to retrieve updates starting from <em>-offset</em> update from the end of the updates queue. All previous updates will be forgotten.</param>
6161
/// <param name="limit">Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.</param>
6262
/// <param name="timeout">Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.</param>
63-
/// <param name="allowedUpdates">A JSON-serialized list of the update types you want your bot to receive. For example, specify <em>["message", "edited_channel_post", "callback_query"]</em> to only receive updates of these types. See <see cref="Update"/> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em>, <em>message_reaction</em>, and <em>message_reaction_count</em> (default). If not specified, the previous setting will be used.<br /><br />Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.</param>
63+
/// <param name="allowedUpdates">A JSON-serialized list of the update types you want your bot to receive. For example, specify <em>["message", "edited_channel_post", "callback_query"]</em> to only receive updates of these types. See <see cref="Update"/> for a complete list of available update types. Specify an empty list to receive all update types except <em>chat_member</em>, <em>message_reaction</em>, and <em>message_reaction_count</em> (default). If not specified, the previous setting will be used.<br /><br />Please note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time.</param>
6464
/// <param name="cancellationToken">The cancellation token to cancel operation.</param>
6565
/// <exception cref="ArgumentNullException">Thrown if <paramref name="client"/> is <c>null</c>.</exception>
6666
/// <exception cref="BotRequestException">Thrown if the request to the Telegram Bot API fails.</exception>

src/library/Telegram.BotAPI/GettingUpdates/setWebhook.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Telegram.BotAPI.GettingUpdates;
1212
public static partial class GettingUpdatesExtensions
1313
{
1414
/// <summary>
15-
/// Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized <see cref="Update"/>. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns <em>True</em> on success.
15+
/// Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized <see cref="Update"/>. In case of an unsuccessful request (a request with response <a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes">HTTP status code</a> different from <em>2XY</em>), we will repeat the request and give up after a reasonable amount of attempts. Returns <em>True</em> on success.
1616
/// If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter <em>secret_token</em>. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.
1717
/// </summary>
1818
/// <param name="client">The <see cref="ITelegramBotClient"/> instance.</param>
@@ -24,7 +24,7 @@ public static bool SetWebhook(this ITelegramBotClient client, SetWebhookArgs arg
2424
client.SetWebhookAsync(args).GetAwaiter().GetResult();
2525

2626
/// <summary>
27-
/// Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized <see cref="Update"/>. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns <em>True</em> on success.
27+
/// Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized <see cref="Update"/>. In case of an unsuccessful request (a request with response <a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes">HTTP status code</a> different from <em>2XY</em>), we will repeat the request and give up after a reasonable amount of attempts. Returns <em>True</em> on success.
2828
/// If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter <em>secret_token</em>. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.
2929
/// </summary>
3030
/// <param name="client">The <see cref="ITelegramBotClient"/> instance.</param>
@@ -44,7 +44,7 @@ public static Task<bool> SetWebhookAsync(this ITelegramBotClient client, SetWebh
4444
}
4545

4646
/// <summary>
47-
/// Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized <see cref="Update"/>. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns <em>True</em> on success.
47+
/// Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized <see cref="Update"/>. In case of an unsuccessful request (a request with response <a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes">HTTP status code</a> different from <em>2XY</em>), we will repeat the request and give up after a reasonable amount of attempts. Returns <em>True</em> on success.
4848
/// If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter <em>secret_token</em>. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.
4949
/// </summary>
5050
/// <param name="client">The <see cref="ITelegramBotClient"/> instance.</param>
@@ -62,7 +62,7 @@ public static bool SetWebhook(this ITelegramBotClient client, string url, InputF
6262
client.SetWebhookAsync(url, certificate, ipAddress, maxConnections, allowedUpdates, dropPendingUpdates, secretToken).GetAwaiter().GetResult();
6363

6464
/// <summary>
65-
/// Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized <see cref="Update"/>. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns <em>True</em> on success.
65+
/// Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized <see cref="Update"/>. In case of an unsuccessful request (a request with response <a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes">HTTP status code</a> different from <em>2XY</em>), we will repeat the request and give up after a reasonable amount of attempts. Returns <em>True</em> on success.
6666
/// If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter <em>secret_token</em>. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.
6767
/// </summary>
6868
/// <param name="client">The <see cref="ITelegramBotClient"/> instance.</param>

src/library/Telegram.BotAPI/InlineMode/InlineQueryResult/InlineQueryResultArticle.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ public class InlineQueryResultArticle : InlineQueryResult
4747
[JsonPropertyName(PropertyNames.Url)]
4848
public string? Url { get; set; }
4949

50-
/// <summary>
51-
/// Optional. Pass <em>True</em> if you don't want the URL to be shown in the message
52-
/// </summary>
53-
[JsonPropertyName(PropertyNames.HideUrl)]
54-
public bool? HideUrl { get; set; }
55-
5650
/// <summary>
5751
/// Optional. Short description of the result
5852
/// </summary>

src/library/Telegram.BotAPI/InlineMode/InlineQueryResult/InlineQueryResultGif.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class InlineQueryResultGif : InlineQueryResult
2424
public override string Id { get; set; } = null!;
2525

2626
/// <summary>
27-
/// A valid URL for the GIF file. File size must not exceed 1MB
27+
/// A valid URL for the GIF file
2828
/// </summary>
2929
[JsonPropertyName(PropertyNames.GifUrl)]
3030
public string GifUrl { get; set; } = null!;

src/library/Telegram.BotAPI/InlineMode/InlineQueryResult/InlineQueryResultMpeg4Gif.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class InlineQueryResultMpeg4Gif : InlineQueryResult
2424
public override string Id { get; set; } = null!;
2525

2626
/// <summary>
27-
/// A valid URL for the MPEG4 file. File size must not exceed 1MB
27+
/// A valid URL for the MPEG4 file
2828
/// </summary>
2929
[JsonPropertyName(PropertyNames.Mpeg4Url)]
3030
public string Mpeg4Url { get; set; } = null!;

src/library/Telegram.BotAPI/MethodNames.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ public static partial class MethodNames
8181
public const string PinChatMessage = "pinChatMessage";
8282
public const string PromoteChatMember = "promoteChatMember";
8383
public const string RefundStarPayment = "refundStarPayment";
84+
public const string RemoveChatVerification = "removeChatVerification";
85+
public const string RemoveUserVerification = "removeUserVerification";
8486
public const string ReopenForumTopic = "reopenForumTopic";
8587
public const string ReopenGeneralForumTopic = "reopenGeneralForumTopic";
8688
public const string ReplaceStickerInSet = "replaceStickerInSet";
@@ -141,5 +143,7 @@ public static partial class MethodNames
141143
public const string UnpinAllGeneralForumTopicMessages = "unpinAllGeneralForumTopicMessages";
142144
public const string UnpinChatMessage = "unpinChatMessage";
143145
public const string UploadStickerFile = "uploadStickerFile";
146+
public const string VerifyChat = "verifyChat";
147+
public const string VerifyUser = "verifyUser";
144148
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
145149
}

0 commit comments

Comments
 (0)