From 3fe166818e297de3d10b6ac06487684ee9137135 Mon Sep 17 00:00:00 2001 From: Niklas Weimann Date: Sat, 24 Feb 2024 22:28:49 +0100 Subject: [PATCH] Add support for v7.1 --- README.md | 2 +- src/RxTelegram.Bot/Interface/BaseTypes/Chat.cs | 16 +++++++++++++++- .../Interface/BaseTypes/ChatBoostAdded.cs | 12 ++++++++++++ .../Interface/BaseTypes/Message.cs | 15 +++++++++++++++ src/RxTelegram.Bot/Interface/BaseTypes/Story.cs | 11 ++++++++++- .../Interface/BaseTypes/WriteAccessAllowed.cs | 1 - src/RxTelegram.Bot/RxTelegram.Bot.csproj | 2 +- 7 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 src/RxTelegram.Bot/Interface/BaseTypes/ChatBoostAdded.cs diff --git a/README.md b/README.md index 79dc685..34ccd02 100644 --- a/README.md +++ b/README.md @@ -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.0 (as at December 29, 2023). +RxTelegram.Bot supports Telegram Bot API 7.1 (as at February 16, 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). diff --git a/src/RxTelegram.Bot/Interface/BaseTypes/Chat.cs b/src/RxTelegram.Bot/Interface/BaseTypes/Chat.cs index 1db0bce..20e4505 100644 --- a/src/RxTelegram.Bot/Interface/BaseTypes/Chat.cs +++ b/src/RxTelegram.Bot/Interface/BaseTypes/Chat.cs @@ -162,6 +162,12 @@ public class Chat /// public int? SlowModeDelay { get; set; } + /// + /// Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore + /// slow mode and chat permissions. Returned only in . + /// + public int? UnrestrictBoostCount { get; set; } + /// /// Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. /// Returned only in getChat. @@ -199,10 +205,18 @@ public class Chat public string StickerSetName { get; set; } /// - /// Optional. True, if the bot can change the group sticker set. Returned only in getChat. + /// Optional. True, if the bot can change the group sticker set. + /// Returned only in . /// public bool? CanSetStickerSet { get; set; } + /// + /// Optional. For supergroups, the name of the group's custom emoji sticker set. + /// Custom emoji from this set can be used by all users and bots in the group. + /// Returned only in . + /// + public string CustomEmojiStickerSetName { get; set; } + /// /// Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; /// for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages diff --git a/src/RxTelegram.Bot/Interface/BaseTypes/ChatBoostAdded.cs b/src/RxTelegram.Bot/Interface/BaseTypes/ChatBoostAdded.cs new file mode 100644 index 0000000..34307ea --- /dev/null +++ b/src/RxTelegram.Bot/Interface/BaseTypes/ChatBoostAdded.cs @@ -0,0 +1,12 @@ +namespace RxTelegram.Bot.Interface.BaseTypes; + +/// +/// This object represents a service message about a user boosting a chat. +/// +public class ChatBoostAdded +{ + /// + /// Number of boosts added by the user + /// + public int BoostCount { get; set; } +} diff --git a/src/RxTelegram.Bot/Interface/BaseTypes/Message.cs b/src/RxTelegram.Bot/Interface/BaseTypes/Message.cs index 46afc70..dc87a4f 100644 --- a/src/RxTelegram.Bot/Interface/BaseTypes/Message.cs +++ b/src/RxTelegram.Bot/Interface/BaseTypes/Message.cs @@ -35,6 +35,16 @@ public class Message /// public Chat SenderChat { get; set; } + /// + /// Optional. If the sender of the message boosted the chat, the number of boosts added by the user + /// + public int? SenderBoostCount { get; set; } + + /// + /// Optional. If the sender of the message boosted the chat, the number of boosts added by the user + /// + public ChatBoostAdded BoostAdded { get; set; } + /// /// Date the message was sent /// @@ -76,6 +86,11 @@ public class Message /// public TextQuote Quote { get; set; } + /// + /// Optional. For replies to a story, the original story + /// + public Story ReplyToStory { get; set; } + /// /// Optional. Bot through which the message was sent /// diff --git a/src/RxTelegram.Bot/Interface/BaseTypes/Story.cs b/src/RxTelegram.Bot/Interface/BaseTypes/Story.cs index 4d4dc8c..05dd390 100644 --- a/src/RxTelegram.Bot/Interface/BaseTypes/Story.cs +++ b/src/RxTelegram.Bot/Interface/BaseTypes/Story.cs @@ -1,8 +1,17 @@ namespace RxTelegram.Bot.Interface.BaseTypes; /// -/// This object represents a message about a forwarded story in the chat. Currently holds no information. +/// This object represents a message about a forwarded story in the chat. /// public class Story { + /// + /// Unique identifier for the story in the chat + /// + public int Id { get; set; } + + /// + /// Chat that posted the story + /// + public Chat Chat { get; set; } } diff --git a/src/RxTelegram.Bot/Interface/BaseTypes/WriteAccessAllowed.cs b/src/RxTelegram.Bot/Interface/BaseTypes/WriteAccessAllowed.cs index b33e062..661a033 100644 --- a/src/RxTelegram.Bot/Interface/BaseTypes/WriteAccessAllowed.cs +++ b/src/RxTelegram.Bot/Interface/BaseTypes/WriteAccessAllowed.cs @@ -2,7 +2,6 @@ namespace RxTelegram.Bot.Interface.BaseTypes; /// /// This object represents a service message about a user allowing a bot added to the attachment menu to write messages. -/// Currently holds no information. /// public class WriteAccessAllowed { diff --git a/src/RxTelegram.Bot/RxTelegram.Bot.csproj b/src/RxTelegram.Bot/RxTelegram.Bot.csproj index 833eed3..49a896b 100644 --- a/src/RxTelegram.Bot/RxTelegram.Bot.csproj +++ b/src/RxTelegram.Bot/RxTelegram.Bot.csproj @@ -10,7 +10,7 @@ https://github.com/RxTelegram/RxTelegram.Bot git Telegram;Bot;Api;Rx;Reactive;Observable;RxTelegram;RxTelegram.Bot - 7.0.0 + 7.1.0 icon.png true bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml