Skip to content

Commit 36c19d4

Browse files
committed
Add support for v7.3
1 parent bcb9cec commit 36c19d4

25 files changed

+597
-252
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
| WARNING: Be careful when installing RxTelegram.Bot. DO NOT INSTALL RxTelegram.Bot2. Since RxTelegram.Bot2 does not send your Requests to the official Telegram API and can read your entire traffic. |
2-
| --- |
31
# RxTelegram.Bot
42

53
[![NuGet](http://img.shields.io/nuget/v/RxTelegram.Bot.svg)](https://www.nuget.org/packages/RxTelegram.Bot)
64
[![Downloads](https://img.shields.io/nuget/dt/RxTelegram.Bot.svg)](https://www.nuget.org/packages/RxTelegram.Bot)
75
[![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)
86
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=RxTelegram_RxTelegram.Bot&metric=coverage)](https://sonarcloud.io/summary/new_code?id=RxTelegram_RxTelegram.Bot)
97

10-
RxTelegram.Bot supports Telegram Bot API 7.2 (as at March 31, 2024).
8+
RxTelegram.Bot supports Telegram Bot API 7.3 (as at May 6, 2024).
119

1210
This is a reactive designed .NET Library for the Telegram Bot API. It works with the official [Reactive Extentions](https://github.com/dotnet/reactive).
1311

src/RxTelegram.Bot/ITelegramBot.cs

Lines changed: 66 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ public interface ITelegramBot
185185
/// <param name="editMessageLiveLocation">Details for the live location to edit.</param>
186186
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
187187
/// <returns>On success, if the edited message was sent by the bot, the edited <see cref="Message" /> is returned, otherwise True is returned.</returns>
188-
Task<Message> EditMessageLiveLocation(EditMessageLiveLocation editMessageLiveLocation, CancellationToken cancellationToken = default);
188+
Task<Message> EditMessageLiveLocation(
189+
EditMessageLiveLocation editMessageLiveLocation,
190+
CancellationToken cancellationToken = default);
189191

190192
/// <summary>
191193
/// Use this method to get up to date information about the chat (current name of the user for one-on-one conversations,
@@ -194,7 +196,7 @@ public interface ITelegramBot
194196
/// <param name="getChat">ChatId for the request.</param>
195197
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
196198
/// <returns>Returns a <see cref="Chat" /> object on success.</returns>
197-
Task<Chat> GetChat(GetChat getChat, CancellationToken cancellationToken = default);
199+
Task<ChatFullInfo> GetChat(GetChat getChat, CancellationToken cancellationToken = default);
198200

199201
/// <summary>
200202
/// Use this method to get information about a member of a chat.
@@ -218,7 +220,9 @@ public interface ITelegramBot
218220
/// <param name="getUserProfilePhotos">Filter for the requested username.</param>
219221
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
220222
/// <returns>Returns a <see cref="UserProfilePhotos" /> object.</returns>
221-
Task<UserProfilePhotos> GetUserProfilePhotos(GetUserProfilePhotos getUserProfilePhotos, CancellationToken cancellationToken = default);
223+
Task<UserProfilePhotos> GetUserProfilePhotos(
224+
GetUserProfilePhotos getUserProfilePhotos,
225+
CancellationToken cancellationToken = default);
222226

223227
/// <summary>
224228
/// Use this method to get a list of administrators in a chat.
@@ -376,7 +380,9 @@ Task<IEnumerable<ChatMember>> GetChatAdministrators(
376380
/// <param name="setStickerSetThumbnail">Sets the thumbnail picture for the sticker set.</param>
377381
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
378382
/// <returns>Returns True on success.</returns>
379-
Task<bool> SetStickerSetThumbnail(SetStickerSetThumbnail setStickerSetThumbnail, CancellationToken cancellationToken = default);
383+
Task<bool> SetStickerSetThumbnail(
384+
SetStickerSetThumbnail setStickerSetThumbnail,
385+
CancellationToken cancellationToken = default);
380386

381387
/// <summary>
382388
/// Use this method to send static .WEBP or animated .TGS stickers.
@@ -461,7 +467,9 @@ Task<IEnumerable<ChatMember>> GetChatAdministrators(
461467
/// <param name="setStickerPositionInSet">Details for the sticker that should be repositioned in the sticker set.</param>
462468
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
463469
/// <returns>Returns True on success.</returns>
464-
Task<bool> SetStickerPositionInSet(SetStickerPositionInSet setStickerPositionInSet, CancellationToken cancellationToken = default);
470+
Task<bool> SetStickerPositionInSet(
471+
SetStickerPositionInSet setStickerPositionInSet,
472+
CancellationToken cancellationToken = default);
465473

466474
/// <summary>
467475
/// Use this method when you need to tell the user that something is happening on the bot's side.
@@ -538,15 +546,19 @@ Task<bool> SetChatAdministratorCustomTitle(
538546
/// Will return the score of the specified user and several of their neighbors in a game.
539547
/// On success, returns an Array of GameHighScore objects.
540548
/// </returns>
541-
Task<IEnumerable<GameHighScore>> GetGameHighScores(GetGameHighScores getGameHighScores, CancellationToken cancellationToken = default);
549+
Task<IEnumerable<GameHighScore>> GetGameHighScores(
550+
GetGameHighScores getGameHighScores,
551+
CancellationToken cancellationToken = default);
542552

543553
/// <summary>
544554
/// Use this method to stop updating a live location message before live_period expires.
545555
/// </summary>
546556
/// <param name="stopMessageLiveLocation">MessageId of the liveLocation that should be stopped.</param>
547557
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
548558
/// <returns>On success, if the message was sent by the bot, the sent Message is returned, otherwise True is returned.</returns>
549-
Task<Message> StopMessageLiveLocation(StopMessageLiveLocation stopMessageLiveLocation, CancellationToken cancellationToken = default);
559+
Task<Message> StopMessageLiveLocation(
560+
StopMessageLiveLocation stopMessageLiveLocation,
561+
CancellationToken cancellationToken = default);
550562

551563
Task<bool> StopMessageLiveLocationInlineMessage(
552564
StopMessageLiveLocation stopMessageLiveLocation,
@@ -618,7 +630,9 @@ Task<bool> StopMessageLiveLocationInlineMessage(
618630
/// <param name="editMessageReplyMarkup">New reply markup for the message.</param>
619631
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
620632
/// <returns>On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.</returns>
621-
Task<Message> EditMessageReplyMarkup(EditMessageReplyMarkup editMessageReplyMarkup, CancellationToken cancellationToken = default);
633+
Task<Message> EditMessageReplyMarkup(
634+
EditMessageReplyMarkup editMessageReplyMarkup,
635+
CancellationToken cancellationToken = default);
622636

623637
/// <summary>
624638
/// Use this method to send invoices.
@@ -645,7 +659,9 @@ Task<bool> StopMessageLiveLocationInlineMessage(
645659
/// <param name="answerPreCheckoutQuery">Answer for the preCheckoutQuery</param>
646660
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
647661
/// <returns>On success, True is returned.</returns>
648-
Task<bool> AnswerPreCheckoutQuery(AnswerPreCheckoutQuery answerPreCheckoutQuery, CancellationToken cancellationToken = default);
662+
Task<bool> AnswerPreCheckoutQuery(
663+
AnswerPreCheckoutQuery answerPreCheckoutQuery,
664+
CancellationToken cancellationToken = default);
649665

650666
/// <summary>
651667
/// Informs a user that some of the Telegram Passport elements they provided contains errors.
@@ -765,7 +781,9 @@ Task<bool> StopMessageLiveLocationInlineMessage(
765781
/// <param name="createChatInviteLink">Details for the chat invite link to create.</param>
766782
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
767783
/// <returns>Returns the new invite link as <see cref="ChatInviteLink"/>.</returns>
768-
Task<ChatInviteLink> CreateChatInviteLink(CreateChatInviteLink createChatInviteLink, CancellationToken cancellationToken = default);
784+
Task<ChatInviteLink> CreateChatInviteLink(
785+
CreateChatInviteLink createChatInviteLink,
786+
CancellationToken cancellationToken = default);
769787

770788
/// <summary>
771789
/// Use this method to edit a non-primary invite link created by the bot.
@@ -784,7 +802,9 @@ Task<bool> StopMessageLiveLocationInlineMessage(
784802
/// <param name="revokeChatInviteLink">Details for the invite link to revoke.</param>
785803
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
786804
/// <returns>Returns the revoked invite link as <see cref="ChatInviteLink"/> object.</returns>
787-
Task<ChatInviteLink> RevokeChatInviteLink(RevokeChatInviteLink revokeChatInviteLink, CancellationToken cancellationToken = default);
805+
Task<ChatInviteLink> RevokeChatInviteLink(
806+
RevokeChatInviteLink revokeChatInviteLink,
807+
CancellationToken cancellationToken = default);
788808

789809
/// <summary>
790810
/// Use this method to approve a chat join request.
@@ -793,7 +813,9 @@ Task<bool> StopMessageLiveLocationInlineMessage(
793813
/// <param name="approveChatJoinRequest">Join request to approve</param>
794814
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
795815
/// <returns>Returns True on success.</returns>
796-
Task<bool> ApproveChatJoinRequest(ApproveChatJoinRequest approveChatJoinRequest, CancellationToken cancellationToken = default);
816+
Task<bool> ApproveChatJoinRequest(
817+
ApproveChatJoinRequest approveChatJoinRequest,
818+
CancellationToken cancellationToken = default);
797819

798820
/// <summary>
799821
/// Use this method to decline a chat join request.
@@ -802,7 +824,9 @@ Task<bool> StopMessageLiveLocationInlineMessage(
802824
/// <param name="declineChatJoinRequest">Join request to decline</param>
803825
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
804826
/// <returns>Returns True on success.</returns>
805-
Task<bool> DeclineChatJoinRequest(DeclineChatJoinRequest declineChatJoinRequest, CancellationToken cancellationToken = default);
827+
Task<bool> DeclineChatJoinRequest(
828+
DeclineChatJoinRequest declineChatJoinRequest,
829+
CancellationToken cancellationToken = default);
806830

807831
/// <summary>
808832
/// Use this method to ban a channel chat in a supergroup or a channel.
@@ -876,7 +900,9 @@ Task<ChatAdministratorRights> GetMyDefaultAdministratorRights(
876900
/// <param name="getCustomEmojiStickers">Sticker ids to get</param>
877901
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
878902
/// <returns>Returns an Array of Sticker objects.</returns>
879-
Task<Sticker[]> GetCustomEmojiStickers(GetCustomEmojiStickers getCustomEmojiStickers, CancellationToken cancellationToken = default);
903+
Task<Sticker[]> GetCustomEmojiStickers(
904+
GetCustomEmojiStickers getCustomEmojiStickers,
905+
CancellationToken cancellationToken = default);
880906

881907
/// <summary>
882908
/// Use this method to create a topic in a forum supergroup chat.
@@ -960,7 +986,9 @@ Task<bool> UnpinAllForumTopicMessages(
960986
/// <param name="closeGeneralForumTopic">General Forum Topic to close</param>
961987
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
962988
/// <returns>Returns True on success.</returns>
963-
Task<bool> CloseGeneralForumTopic(CloseGeneralForumTopic closeGeneralForumTopic, CancellationToken cancellationToken = default);
989+
Task<bool> CloseGeneralForumTopic(
990+
CloseGeneralForumTopic closeGeneralForumTopic,
991+
CancellationToken cancellationToken = default);
964992

965993
/// <summary>
966994
/// Use this method to reopen a closed 'General' topic in a forum supergroup chat.
@@ -970,7 +998,9 @@ Task<bool> UnpinAllForumTopicMessages(
970998
/// <param name="reopenGeneralForumTopic">General forum topic to reopen</param>
971999
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
9721000
/// <returns>Returns True on success.</returns>
973-
Task<bool> ReopenGeneralForumTopic(ReopenGeneralForumTopic reopenGeneralForumTopic, CancellationToken cancellationToken = default);
1001+
Task<bool> ReopenGeneralForumTopic(
1002+
ReopenGeneralForumTopic reopenGeneralForumTopic,
1003+
CancellationToken cancellationToken = default);
9741004

9751005
/// <summary>
9761006
/// Use this method to hide the 'General' topic in a forum supergroup chat.
@@ -989,7 +1019,9 @@ Task<bool> UnpinAllForumTopicMessages(
9891019
/// <param name="unhideGeneralForumTopic">General Forum topic to unhide</param>
9901020
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
9911021
/// <returns>Returns True on success.</returns>
992-
Task<bool> UnhideGeneralForumTopic(UnhideGeneralForumTopic unhideGeneralForumTopic, CancellationToken cancellationToken = default);
1022+
Task<bool> UnhideGeneralForumTopic(
1023+
UnhideGeneralForumTopic unhideGeneralForumTopic,
1024+
CancellationToken cancellationToken = default);
9931025

9941026
/// <summary>
9951027
/// Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.
@@ -1077,7 +1109,9 @@ Task<bool> SetCustomEmojiStickerSetThumbnail(
10771109
/// <param name="setStickerMaskPosition">Mask position to set for a sticker</param>
10781110
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
10791111
/// <returns>Returns True on success.</returns>
1080-
Task<bool> SetStickerMaskPosition(SetStickerMaskPosition setStickerMaskPosition, CancellationToken cancellationToken = default);
1112+
Task<bool> SetStickerMaskPosition(
1113+
SetStickerMaskPosition setStickerMaskPosition,
1114+
CancellationToken cancellationToken = default);
10811115

10821116
/// <summary>
10831117
/// Use this method to change the bot's name.
@@ -1131,8 +1165,8 @@ Task<bool> UnpinAllGeneralForumTopicMessages(
11311165
/// </summary>
11321166
/// <param name="forwardMessages">MessageIds to forward</param>
11331167
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
1134-
/// <returns>Returns True on success.</returns>
1135-
Task<bool> ForwardMessages(ForwardMessages forwardMessages, CancellationToken cancellationToken = default);
1168+
/// <returns>On success, an array of<see cref="MessageIdObject"/> with the send messages is returned.</returns>
1169+
Task<MessageIdObject[]> ForwardMessages(ForwardMessages forwardMessages, CancellationToken cancellationToken = default);
11361170

11371171
/// <summary>
11381172
/// Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat.
@@ -1161,4 +1195,16 @@ Task<BusinessConnection> GetBusinessConnection(
11611195
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
11621196
/// <returns>Returns True on success.</returns>
11631197
Task<bool> ReplaceStickerInSet(ReplaceStickerInSet replaceStickerInSet, CancellationToken cancellationToken = default);
1198+
1199+
/// <summary>
1200+
/// Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped.
1201+
/// Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied.
1202+
/// A quiz poll can be copied only if the value of the field correct_option_id is known to the bot.
1203+
/// The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message.
1204+
/// Album grouping is kept for copied messages.
1205+
/// </summary>
1206+
/// <param name="copyMessages">Information about the messages to copy</param>
1207+
/// <param name="cancellationToken">Propagates notification that operations should be canceled.</param>
1208+
/// <returns>Returns an array of <see cref="MessageIdObject"/> on success.</returns>
1209+
Task<MessageIdObject[]> CopyMessages(CopyMessages copyMessages, CancellationToken cancellationToken = default);
11641210
}

0 commit comments

Comments
 (0)