Telegram.Bot v16.0.0-alpha.1 Release Notes

Release Date: 2021-05-01 // almost 3 years ago
  • Bot API 5.1 (March 9, 2021)

    Bot API 5.0 (November 4, 2020)

    ➕ Added

    • The method ITelegramBotClient.CreateChatInviteLinkAsync
    • The method ITelegramBotClient.EditChatInviteLinkAsync
    • The method ITelegramBotClient.RevokeChatInviteLinkAsync
    • Optional parameter revokeMessages to ITelegramBotClient.KickChatMemberAsync
    • Optional parameters canManageChat, canManageVoiceChats to ITelegramBotClient.KickChatMemberAsync
    • Property RevokeMessages to KickChatMemberRequest
    • Properties CanManageChat, CanManageVoiceChats to PromoteChatMemberRequest
    • Properties CanManageChat, CanManageVoiceChats to ChatMember
    • Properties MessageAutoDeleteTimerChanged, VoiceChatStarted, VoiceChatEnded, VoiceChatParticipantsInvited to Message
    • ⚡️ Properties MyChatMember and ChatMember to Update
    • ⚡️ Types CreateChatInviteLinkRequest, EditChatInviteLinkRequest, RevokeChatInviteLinkRequest, ChatInviteLink, ChatMemberUpdated, MessageAutoDeleteTimerChanged, VoiceChatEnded, VoiceChatParticipantsInvited, VoiceChatStarted
    • 🆕 New enum value Bowling for Emoji
    • 🆕 New enum values MessageAutoDeleteTimerChanged, ProximityAlertTriggered, VoiceChatStarted, VoiceChatEnded, VoiceChatParticipantsInvited for MessageType
    • 🆕 New enum values MyChatMember, ChatMember for UpdateType
    • Delegate AsyncEventHandler<T>
    • Methods:
      • ITelegramBotClient.LogOutAsync
      • ITelegramBotClient.CloseAsync
      • ITelegramBotClient.CopyMessageAsync
      • ITelegramBotClient.UnpinAllChatMessages
    • Optional parameter ipAddress to ITelegramBotClient.SetWebhookAsync
    • ⚡️ Optional parameter dropPendingUpdates to ITelegramBotClient.SetWebhookAsync, ITelegramBotClient.DeleteWebhookAsync
    • Optional parameter allowSendingWithoutReply to the methods SendTextMessageAsync, SendPhotoAsync, SendVideoAsync, SendAnimationAsync, SendAudioAsync, SendDocumentAsync, SendStickerAsync, SendVideoNoteAsync, SendVoiceAsync, SendLocationAsync, SendVenueAsync, SendContactAsync, SendPollAsync, SendDiceAsync, SendInvoiceAsync, SendGameAsync, SendMediaGroupAsync
    • Optional parameter captionEntities to SendTextMessageAsync, SendPhotoAsync, SendVideoAsync, SendAnimationAsync, SendAudioAsync, SendDocumentAsync, SendVoiceAsync, SendPollAsync, EditMessageTextAsync, EditMessageCaptionAsync
    • Optional parameter isAnonymous to ITelegramBotClient.PromoteChatMemberAsync
    • Optional parameter messageId to ITelegramBotClient.UnpinChatMessageAsync
    • Optional parameter onlyIfBanned to ITelegramBotClient.UnbanChatMemberAsync
    • Optional parameter disableContentTypeDetection to ITelegramBotClient.SendDocumentAsync
    • Optional parameter heading to ITelegramBotClient.SendLocationAsync, ITelegramBotClient.EditMessageLiveLocationAsync
    • Optional parameter proximityAlertRadius to ITelegramBotClient.SendLocationAsync, ITelegramBotClient.EditMessageLiveLocationAsync
    • Optional parameter horizontalAccuracy to ITelegramBotClient.SendLocationAsync, ITelegramBotClient.EditMessageLiveLocationAsync
    • Optional parameters googlePlaceId, googlePlaceType to ITelegramBotClient.SendVenueAsync
    • Property IpAddress to SetWebhookRequest, WebhookInfo
    • ⚡️ Property DropPendingUpdates to SetWebhookRequest, DeleteWebhookRequest
    • Property AllowSendingWithoutReply to SendMessageRequest, SendPhotoRequest, SendAudioRequest, SendDocumentRequest, SendStickerRequest, SendVideoRequest, SendAnimationRequest, SendVoiceRequest, SendVideoNoteRequest, SendMediaGroupRequest, SendLocationRequest, SendVenueRequest, SendContactRequest, SendPollRequest, SendDiceRequest, SendInvoiceRequest, SendGameRequest
    • Property CaptionEntities to InputMediaBase, InlineQueryResultPhoto, InlineQueryResultGif, InlineQueryResultMpeg4Gif, InlineQueryResultVideo, InlineQueryResultAudio, InlineQueryResultVoice, InlineQueryResultDocument, InlineQueryResultCachedPhoto, InlineQueryResultCachedGif, InlineQueryResultCachedMpeg4Gif, InlineQueryResultCachedVideo, InlineQueryResultCachedAudio, InlineQueryResultCachedVoice, InlineQueryResultCachedDocument
    • Property Entities to InputTextMessageContent
    • Properties SenderChat, AuthorSignature, ProximityAlertTriggered to Message
    • Properties Bio, LinkedChatId, Location to Chat
    • Property IsAnonymous to ChatMember, PromoteChatMemberRequest
    • Property LivePeriod to Location
    • Property ProximityAlertRadius to Location, InlineQueryResultLocation, InputLocationMessageContent, SendLocationRequest, EditMessageLiveLocationRequest, EditInlineMessageLiveLocationRequest
    • Property HorizontalAccuracy to Location, InlineQueryResultLocation, InputLocationMessageContent, SendLocationRequest, EditMessageLiveLocationRequest, EditInlineMessageLiveLocationRequest
    • Property Heading to Location, InlineQueryResultLocation, SendLocationRequest, EditMessageLiveLocationRequest, EditInlineMessageLiveLocationRequest
    • Property MessageId to PinChatMessageRequest
    • Property OnlyIfBanned to UnbanChatMemberRequest
    • Property FileName to Audio, Video
    • Property DisableContentTypeDetection to MakeRequestAsync, InputMediaDocument
    • Properties GooglePlaceId, GooglePlaceType to SendVenueRequest, Venue, InlineQueryResultVenue, InputVenueMessageContent
    • 🆕 New enum values Football, SlotMachine for Emoji
    • Type ChatLocation
    • Type ProximityAlertTriggered
    • 👌 Support for sending and receiving audio and document albums in the method SendMediaGroupAsync

    🔄 Changed

    • Constructor in TelegramBotClient accepts base url for custom Bot API server as optional third parameter, it accepts only URL's with protocol, host and port parts, everything else is ignored
    • Marked constructor for TelegramBotClient accepting IWebProxy as obsolete
    • Property ITelegramBotClient.BotId to long?
    • Event MakingApiRequest renamed to OnMakingApiRequest and it's type is changed to AsyncEventHandler<ApiRequestEventArgs>
    • 👀 Event ApiResponseReceived renamed to OnApiResponseReceived and it's type is changed to AsyncEventHandler<ApiResponseEventArgs>
    • 📄 Parameters order in following methods (to reflect official docs):
      • SetWebhookAsync, DeleteWebhookAsync, SendTextMessageAsync, SendPhotoAsync, SendAudioAsync, SendDocumentAsync, SendStickerAsync, SendVideoAsync, SendAnimationAsync, SendVoiceAsync, SendVideoNoteAsync, SendMediaGroupAsync, SendLocationAsync, SendVenueAsync, SendContactAsync, SendPollAsync, SendDiceAsync, KickChatMemberAsync, UnbanChatMemberAsync, PromoteChatMemberAsync, EditMessageTextAsync, EditMessageCaptionAsync, EditMessageLiveLocationAsync, SendInvoiceAsync, SendGameAsync
    • 📦 Polling inside the library is now considered obsolete. The code, related to polling will be removed. It is recommended to use Telegram.Bot.Extensions.Polling package instead.
      • These methods are now obsolete: StartReceiving, StopReceiving
      • These events are now obsolete: OnUpdate, OnMessage, OnMessageEdited, OnInlineQuery, OnInlineResultChosen, OnCallbackQuery, OnReceiveError, OnReceiveGeneralError
      • These fields are now obsolete: IsReceiving, MessageOffset
    • Error 429 Too Many Request is now handled by the client and is thrown as ApiRequestException

    ⚠ >⚠️ WARNING! ⚠️

    After one of the upcoming Bot API updates, some user identifiers will become bigger than 231 - 1 and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

    🛠 Fixed

    • Incorrect property name ExplanationCaptionEntities -> ExplanationEntities in SendPollRequest

    ✂ Removed

    • Obsolete overload method ITelegramBotClient.DownloadFileAsync
    • Obsolete overload method ITelegramBotClient.SendMediaGroupAsync
    • Obsolete constructor for SendMediaGroupRequest
    • Obsolete constructor for InputMediaPhoto
    • Obsolete constructor for InputMediaVideo
    • Obsolete property AllMembersAreAdministrators from Chat
    • Obsolete property IsForwarded from Message
    • Obsolete value Animation from enum MessageType