Skip to content

Releases: InsanusMokrassar/ktgbotapi

36.1.0

Choose a tag to compare

@InsanusMokrassar InsanusMokrassar released this 21 Aug 19:35
b23ec8b
  • Dependencies:
    • Update com.gradleup.nmcp.aggregation:com.gradleup.nmcp.aggregation.gradle.plugin from 1.6.0 to 1.6.1
    • Update com.google.devtools.ksp:symbol-processing-api from 2.3.9 to 2.3.11
    • Update io.ktor:ktor-client-core from 3.5.1 to 3.5.2
    • Update dev.inmo:kslog from 1.6.1 to 1.7.0
    • Update dev.inmo:micro_utils.colors.common from 0.30.0 to 0.30.1

36.0.0

Choose a tag to compare

@InsanusMokrassar InsanusMokrassar released this 21 Aug 10:20

THIS UPDATE CONTAINS SUPPORT OF TELEGRAM BOTS API 10.2

Breaking changes:

  • RichBlockTableCell.align now uses the string-serialized RichBlockTableCellAlign sealed hierarchy (Left, Center, or Right) instead of String
  • RichBlockTableCell.valign now uses the string-serialized RichBlockTableCellVAlign sealed hierarchy (Top, Middle, or Bottom) instead of String
  • RichBlockTableCell is now a sealed interface with Header and Regular implementations; the input table DSL uses headerCell and cell respectively
  • InputRichBlockListItem is now a sealed interface with Ordered and Unordered implementations; ordered items require a non-null value and typed LabelType, while LabelType.Decimals is the default; InputRichBlocksBuilder now exposes separate orderedList and unorderedList DSL functions with matching item builders
  • ReplyParameters is now a sealed interface with nested ReplyParameters.Chat and ReplyParameters.Ephemeral implementations; overloaded ReplyParameters(...) companion factories construct both regular-message and ephemeral-message variants
  • The 4 group-family message implementations (CommonGroupContentMessageImpl, CommonForumContentMessageImpl, CommonChannelDirectMessagesContentMessageImpl, CommonSuggestedChannelDirectMessagesContentMessageImpl) gained trailing receiverUser/ephemeralMessageId primary-constructor parameters (defaulted to null) ��� positional construction of these classes must be updated
  • reply(to = ...) overloads for the 13 ephemeral-capable senders (see below) now detect an ephemeral to target (to is PossiblyEphemeralMessage && to.ephemeralMessageId != null) and automatically address the reply through ephemeral_message_id, sending the outgoing message itself as ephemeral to the same receiver ��� this is a behavior change for any existing code that replies to a message carrying a non-null ephemeralMessageId

Migration advice: Keep ReplyParameters(...) for both chat-message and ephemeral-message targets; explicit ReplyParameters.Ephemeral(...) subtype construction also remains available; pass receiverUser/ephemeralMessageId explicitly (or rely on their null default) when constructing the 4 group-family message implementations positionally

  • Core:
    • (Rich Messages) Added the raw-string-serialized RichBlockTableCellVAlign hierarchy and migrated table-cell vertical alignment from String to RichBlockTableCellVAlign
    • (Rich Messages) Added the raw-string-serialized RichBlockTableCellAlign hierarchy and migrated table-cell alignment from String to RichBlockTableCellAlign
    • (Rich Messages) Split RichBlockTableCell into header/regular variants with a shared flat surrogate serializer; added headerCell to the input table DSL
    • (Rich Messages) Added h1 through h6 shortcuts for plain and rich-text headings in InputRichBlocksBuilder
    • (Rich Messages) Reworked the input table DSL to build cells through nested table { row { cell(...) { } } } builders
    • (Rich Messages) Replaced the flat InputRichBlockListItem data class with ordered/unordered variants, added the string-serialized LabelType hierarchy (A, a, I, i, 1), and split the list DSL into InputRichBlockOrderedListBuilder/InputRichBlockUnorderedListBuilder
    • (Rich Messages) Added InputRichBlock hierarchy with all 21 InputRichBlock* types (mirroring the received RichBlock* hierarchy and reusing RichText/RichBlockCaption/RichBlockTableCell), the label-less InputRichBlockListItem and the InputRichBlockSerializer; every InputRichBlock exposes subBlocks navigation
    • (Rich Messages) Added TelegramMediaVoiceNote (InputMediaVoiceNote) and the RichMessageMemberTelegramMedia marker interface implemented by it, TelegramMediaAnimation, TelegramMediaAudio, TelegramMediaPhoto and TelegramMediaVideo; added VoiceFile.toTelegramMediaVoiceNote converters
    • (Rich Messages) Added InputRichMessageMedia type (media referenced from InputRichMessage.html/.markdown via tg://photo?id=, tg://video?id= and tg://audio?id= links)
    • (Rich Messages) InputRichMessage gained blocks and media fields ("exactly one of html, markdown or blocks must be used") and the InputRichMessageBlocks factory; InputRichMessageHTML/InputRichMessageMarkdown gained a trailing media parameter
    • (Rich Messages) Added Rich Messages input DSL builders buildInputRichBlocks/InputRichBlocksBuilder, typed ordered/unordered list builders and the InputRichMessageBlocks { } builder overload (marked with the @RichTextDsl DSL marker)
    • (Rich Messages) SendRichMessage now supports attach:// upload of new files referenced from InputRichMessage.blocks/.media; SendRichMessageDraft now rejects rich messages that require direct file upload (unsupported by the method)
    • (Ephemeral Messages) Added EphemeralMessageId value class, PossiblyEphemeralMessage (receiverUser/ephemeralMessageId) and EphemeralMessageAction (receiverUserId/ephemeralMessageId) abstractions
    • (Ephemeral Messages) RawMessage parses receiver_user/ephemeral_message_id; the 4 group-family Common*ContentMessage types (CommonGroupContentMessage, CommonForumContentMessage, CommonChannelDirectMessagesContentMessage, CommonSuggestedChannelDirectMessagesContentMessage, via the shared PotentiallyFromUserGroupContentMessage) now also implement PossiblyEphemeralMessage
    • (Ephemeral Messages) BotCommand gained the isEphemeral field
    • (Ephemeral Messages) ReplyParameters became a sealed interface with nested Chat and Ephemeral implementations and a shared surrogate-backed serializer preserving the flat Bot API JSON shape; added the Message.ephemeralReplyParametersOrNull()/Message.ephemeralReplyReceiverUserIdOrNull helpers used by the reply(to = ...) smart-branch
    • (Ephemeral Messages) ReplyParameters.Ephemeral and Message.ephemeralReplyParametersOrNull() support and forward allowSendingWithoutReply, checklistTaskId, and pollOptionId together with ephemeralMessageId
    • (Ephemeral Messages) Added receiverUserId/callbackQueryId params (via the new OptionallyEphemeralSendRequest) to the 13 ephemeral-capable send requests: SendTextMessage, SendContact, SendLocation (Static/Live), SendVenue, SendPhotoData, SendLivePhotoData, SendAudioData, SendDocumentData, SendVideoData, SendAnimationData, SendVoiceData, SendVideoNoteData, SendStickerByFileId
    • (Ephemeral Messages) Added EditEphemeralMessageText/EditEphemeralMessageMedia/EditEphemeralMessageCaption/EditEphemeralMessageReplyMarkup and DeleteEphemeralMessage requests (all return Unit, mirroring the inline-message edit family); EditEphemeralMessageMedia rejects MultipartFile media (new file upload is not supported for ephemeral edits)
    • (Ephemeral Messages) Added EphemeralChatId (IdChatIdentifier, carrying chatId/receiverUser/ephemeralMessageId) and the ChatIdentifier.receiverUser/ChatIdentifier.ephemeralMessageId extensions (mirroring ChatIdentifier.threadId); FullChatIdentifierSerializer gained the chatId/eph/receiverUserChatId/ephemeralMessageId string format. The nullable receiverUserId param of the 13 ephemeral-capable send requests still defaults from the passed chatId when it is an EphemeralChatId; DeleteEphemeralMessage and EditEphemeralMessageText/EditEphemeralMessageCaption/EditEphemeralMessageMedia/EditEphemeralMessageReplyMarkup instead keep receiverUserId/ephemeralMessageId REQUIRED on their primary constructor/factory form, gaining EphemeralChatId-taking secondary constructors/factory overloads that source both params from the identifier (throwing IllegalArgumentException if it carries no ephemeralMessageId)
    • (Communities) Added CommunityId value class and Community type (id/name)
    • (Communities) Added CommunityChatAdded (community) and CommunityChatRemoved (fieldless) chat events (CommonEvent); RawMessage parses community_chat_added/community_chat_removed
    • (Communities) Added community field to ExtendedChat (ChatFullInfo.community), parsed for ExtendedChannelChatImpl, ExtendedGroupChatImpl, ExtendedSupergroupChatImpl, ExtendedForumChatImpl, ExtendedChannelDirectMessagesChatImpl and ExtendedBot
    • (Bot Subscriptions) Added BotSubscriptionUpdated (user, invoicePayload, state) and BotSubscriptionUpdatedUpdate; state is modeled as the typed sealed BotSubscriptionUpdated.State (Canceled/Active/Failed, with an Unknown fallback), mirroring TransactionType
    • (Bot Subscriptions) RawUpdate parses the new subscription field; added UPDATE_SUBSCRIPTION to ALL_UPDATES_LIST_WITHOUT_REACTIONS; FlowsUpdatesFilter gained botSubscriptionUpdatedUpdatesFlow
  • API:
    • (Ephemeral Messages) Threaded receiverUserId/callbackQueryId through the sendXxx/send/reply/replyWithXxx extensions for the 13 ephemeral-capable senders (send/Sends.kt, send/Replies.kt, send/RepliesWithChatsAndMessages.kt and their per-type extension files); reply(to = ...) now automatically sends an ephemeral reply when to is itself ephemeral (see Breaking changes)
    • (Ephemeral Messages) Ephemeral-capable reply(to = ...) overloads gained replyToEphemeralMessageId, defaulting from PossiblyEphemeralMessage.ephemeralMessageId; direct and dispatcher overloads forward the explicit target into ephemeralReplyParametersOrNull
    • (Ephemeral Messages) Added 48 ephemeral-only reply/replyWithXxx overloads in RepliesWithEphemeral.kt without a ChatMessage; each overload requires replyInChatId, receiverUserId, and replyToEphemeralMessageId, with compl...
Read more

35.1.0

Choose a tag to compare

@InsanusMokrassar InsanusMokrassar released this 01 Jul 12:26
  • Dependencies:
    • Kotlin: 2.3.20 -> 2.3.21
    • Coroutines: 1.10.2 -> 1.11.0
    • Ktor: 3.4.2 -> 3.5.1
    • KSP: 2.3.6 -> 2.3.9
    • MicroUtils: 0.29.2 -> 0.30.0
    • Dokka: 2.0.0 -> 2.2.0
    • Versions: 0.53.0 -> 0.54.0
    • NMCP: 1.4.4 -> 1.6.0
  • Build:
    • Updated Gradle wrapper 8.13 -> 9.6.1 and migrated build scripts to be Gradle 9 compatible (Project.exec -> providers.exec, tasks.whenTaskAdded -> tasks.configureEach)
    • Migrated Dokka documentation to the Dokka Gradle Plugin v2: the docs module is now included in the build as the KDocs aggregator (./gradlew :docs:dokkaGenerate) and the Publish KDocs workflow was updated accordingly

35.0.0

Choose a tag to compare

@InsanusMokrassar InsanusMokrassar released this 01 Jul 10:06

THIS UPDATE CONTAINS SUPPORT OF TELEGRAM BOTS API 10.1

Breaking changes:

  • EditTextChatMessage.text changed from String to String? (rich edits carry no text) ��� implementations overriding it must widen the type and readers must handle null
  • EditChatMessageText.text changed from String to String?; its textSources is now null when there is no text ��� code reading text as non-null must handle null
  • ExtendedBot gained the supportsJoinRequestQueries field inserted between supportsGuestQueries and canConnectToBusiness ��� positional constructor calls and componentN destructuring shift and must be updated

Migration advice: Handle nullable text on EditTextChatMessage/EditChatMessageText; construct ExtendedBot with named arguments

  • Core:
    • (Rich Messages) Added RichText (RichTextPlain, RichTextGroup, RichTextEntity) hierarchy with all 25 RichText* entity types and a recursive serializer supporting plain strings, arrays and typed objects; every RichText exposes rawText, markdown and html renderings
    • (Rich Messages) Added RichBlock hierarchy with all 21 RichBlock* types plus RichBlockCaption, RichBlockTableCell and RichBlockListItem; every RichBlock exposes markdown/html source, the RichBlockMedia marker interface and subBlocks/search navigation helpers
    • (Rich Messages) Added RichTextInfo type (with markdown/html source built from its blocks) and RichMessageContent message content; RichMessageContent.createResend re-sends the content (forwarded when it contains media blocks, otherwise re-built through SendRichMessage); parsed rich_message in RawMessage; added RichMessageContentMessage typealias
    • (Rich Messages) Added InputRichMessage (internal constructor with InputRichMessageHTML/InputRichMessageMarkdown factories) and InputRichMessageContent usable as InputMessageContent
    • (Rich Messages) Added Rich Messages DSL builders buildRichText/RichTextBuilder, buildRichBlocks/RichBlocksBuilder, buildRichTextInfo and RichBlockListBuilder (marked with the @RichTextDsl DSL marker)
    • (Rich Messages) Added Rich Markdown/HTML source helpers String.escapeRichMarkdown() and List<RichBlock>.toRichMarkdown()/toRichHtml()
    • (Rich Messages) Added SendRichMessage and SendRichMessageDraft requests
    • (Rich Messages) Added richMessage parameter to EditChatMessageText; its text is now nullable (per API) and the EditChatMessageRichText factory builds a rich edit; widened EditTextChatMessage.text to nullable
    • (Polls) Added Link type (dev.inmo.tgbotapi.types.Link) implementing PollMedia, carrying the url of a link attached to a poll option
    • (Polls) Added link field parsing to PollMedia deserialization/serialization
    • (Polls) Added TelegramMediaLink (InputMediaLink) implementing InputPollOptionMedia, usable as a poll option media
    • (Join Request Queries) Added ChatJoinRequestQueryId value class and queryId field to ChatJoinRequest
    • (Join Request Queries) Added supportsJoinRequestQueries flag to ExtendedBot (User.supports_join_request_queries)
    • (Join Request Queries) Added guardBot field to ExtendedChat (ChatFullInfo.guard_bot), parsed for public chats
    • (Join Request Queries) Added AnswerChatJoinRequestQuery request and ChatJoinRequestQueryResult sealed interface (Approve/Decline/Queue/Unknown) serialized as a plain string
    • (Join Request Queries) Added SendChatJoinRequestWebApp request
  • API:
    • (Rich Messages) Added sendRichMessage and sendRichMessageDraft TelegramBot extensions
    • (Join Request Queries) Added answerChatJoinRequestQuery and sendChatJoinRequestWebApp TelegramBot extensions
  • BehaviourBuilder:
    • (Rich Messages) Added onRichMessage trigger and waitRichMessage/waitRichMessageMessage expectations
  • Utils:
    • (Rich Messages) Added Flow<ContentMessage<*>>.onlyRichMessageContentMessages()
    • (Join Request Queries) Added ChatJoinRequest.query_id raw accessor

34.0.0

Choose a tag to compare

@InsanusMokrassar InsanusMokrassar released this 13 Jun 08:54

THIS UPDATE CONTAINS SUPPORT OF TELEGRAM BOTS API 10.0

THIS UPDATE CONTAINS BREAKING CHANGES

Breaking changes:

  • Removed the CommonMessage<T> super-type ��� replaced by the new sealed ChatContentMessage<T> (CommonContentMessage, ChatMessage); code referencing CommonMessage in types, when branches or signatures must switch to ChatContentMessage
  • Renamed casts commonMessageOrNull/commonMessageOrThrow/ifCommonMessage to chatContentMessageOrNull/chatContentMessageOrThrow/ifChatContentMessage
  • Reworked the message hierarchy (ContentMessage, Message, FromUserMessage, PossiblyEditedMessage, PossiblyForwardedMessage, PossiblyPaymentMessage, PossiblySentViaBotCommonMessage, PossiblyTopicMessage, SignedMessage, ChatEventMessage, PassportMessage) and related typealiases ��� dependent type signatures may need updates
  • Chat send/reply extensions now return ChatContentMessage<*> (previously ContentMessage<*>)
  • ChatPermissions interface gained the abstract canReactToMessages member ��� custom implementations must add it
  • SendMessageDraft no longer throws when the text length is out of range: it now logs a warning and validates against the new draftMessageTextLength (0..textLength.last) range, allowing empty text
  • pollOptionsLimit changed from 2..12 to 1..12

Migration advice: Replace CommonMessage usages with ChatContentMessage, commonMessageOr with chatContentMessageOr

  • Core:
    • (Guest Mode) Added GuestQueryId value class in dev.inmo.tgbotapi.types and WithOptionalGuestQueryId interface in dev.inmo.tgbotapi.abstracts.types
    • (Guest Mode) Added RequestGuestMessage and RequestGuestContentMessage<T> message abstractions (CommonContentMessage, SpecialMessage, FromUserMessage, PossiblySentViaBot) exposing guestQueryId; added PossiblyGuestAnswerMessage exposing guestBotCallerUser and guestBotCallerChat
    • (Guest Mode) Added RequestGuestContentMessageImpl data class implementing RequestGuestContentMessage
    • (Guest Mode) Added SentGuestMessage carrying InlineMessageId
    • (Guest Mode) Added GuestMessageUpdate (BaseSentMessageUpdate) and guest_message update type wiring in RawUpdate/UpdateTypes/FlowsUpdatesFilter
    • (Guest Mode) Added AnswerGuestQuery request returning SentGuestMessage
    • Introduced sealed ChatContentMessage<T> super-type extending CommonContentMessage and ChatMessage, used as the common return type of chat send/reply operations
    • Reworked ContentMessage, Message, FromUserMessage, PossiblyEditedMessage, PossiblyForwardedMessage, PossiblyPaymentMessage, PossiblySentViaBotCommonMessage, PossiblyTopicMessage, SignedMessage, ChatEventMessage, PassportMessage and related typealiases to integrate guest messages and unify chat content messages
    • Updated RawMessage, MessageUpdate, ChannelPostUpdate, BusinessMessageUpdate, EditMessageUpdate, EditChannelPostUpdate, BaseMessageUpdate, BaseEditMessageUpdate, BaseSentMessageUpdate to align with the new hierarchy
    • (Live Photos) Added LivePhotoFile class representing the incoming LivePhoto Telegram type (PollMedia, MediaContentVariant, UsefulAsPaidMediaFile)
    • (Live Photos) Added LivePhotoContent (VisualMediaGroupPartContent) representing live photo messages
    • (Live Photos) Added TelegramMediaLivePhoto (TelegramFreeMedia, VisualMediaGroupMemberTelegramMedia, InputPollMedia, InputPollOptionMedia) ��� usable in sendMediaGroup, editMessageMedia, and polls
    • (Live Photos) Added TelegramPaidMediaLivePhoto (VisualTelegramPaidMedia) for paid live photos
    • (Live Photos) Added PaidMedia.LivePhoto variant and PaidMedia.LivePhoto.toTelegramPaidMediaLivePhoto() conversion
    • (Live Photos) Added livePhotoField constant; added live_photo parsing to RawMessage and ReplyInfo.External surrogate
    • (Live Photos) Added SendLivePhoto request and SendLivePhotoData/SendLivePhotoFiles
    • (Live Photos) Added LivePhotoMessage typealias
    • (Live Photos) Added LivePhotoFile.toTelegramMediaLivePhoto(...) and LivePhotoFile.toTelegramPaidMediaLivePhoto() extensions
    • (Chat Management) Added canReactToMessages field to ChatPermissions (interface, Granular and Common) and RestrictedMemberChatMember
    • (Chat Management) Added optional retrieveOtherBots parameter to GetChatAdministrators request
    • (Chat Management) Added DeleteMessageReaction request with @Warning on primary constructor; added DeleteUserMessageReaction and DeleteActorChatMessageReaction factory functions
    • (Chat Management) Added DeleteAllMessageReactions request with @Warning on primary constructor; added DeleteAllUserMessageReactions and DeleteAllActorChatMessageReactions factory functions
    • (Polls) Added TelegramMediaSticker, TelegramMediaLocation and TelegramMediaVenue classes
    • (Polls) Added InputPollMedia and InputPollOptionMedia sealed interfaces representing input media variants accepted by sendPoll
    • (Polls) Added PollMedia class representing media attached to polls in incoming updates
    • (Polls) Added media field to Poll, PollOption and InputPollOption
    • (Polls) Added explanationMedia field to QuizPoll
    • (Polls) Added membersOnly field to Poll
    • (Polls) Added countryCodes field to Poll
    • (Polls) Added media, membersOnly, countryCodes parameters to SendRegularPoll and SendPoll factory functions
    • (Polls) Added media, explanationMedia, membersOnly, countryCodes parameters to SendQuizPoll factory functions
    • (Polls) Decreased minimum allowed poll options count from 2 to 1 (pollOptionsLimit is now 1..12)
    • (Managed Bots Access) Added BotAccessSettings data class in dev.inmo.tgbotapi.types.managed_bots with isAccessRestricted and addedUsers fields
    • (Managed Bots Access) Added GetManagedBotAccessSettings request returning BotAccessSettings
    • (Managed Bots Access) Added SetManagedBotAccessSettings request with userId and optional addedUserIds (isAccessRestricted is derived from addedUserIds)
    • (Managed Bots Access) Added isAccessRestrictedField, addedUsersField, addedUserIdsField constants
    • (Personal Chat) Added GetUserPersonalChatMessages request returning List<ChatContentMessage<*>>
    • (Drafts) SendMessageDraft now allows empty text via the new draftMessageTextLength (0..textLength.last) range and logs a warning instead of throwing when the text length is out of range
  • API:
    • (Guest Mode) Added answerGuestQuery extensions in dev.inmo.tgbotapi.extensions.api.answers
    • (Guest Mode) Added RepliesWithGuestQueryId.kt reply extensions accepting GuestQueryId
    • (Guest Mode) Updated reply/send extensions (Replies, RepliesWithChatsAndMessages, Sends, ResendMessage, SendChecklist, SendContact, SendDice, SendLiveLocation, SendStaticLocation, SendVenue, SendMessage, media Send*, SendGame, SendInvoice, SendQuizPoll, SendRegularPoll) to return ChatContentMessage<*> and align with the new hierarchy
    • (Live Photos) Added sendLivePhoto extensions (ChatIdentifier/Chat �� InputFile/LivePhotoFile �� text/textSources)
    • (Chat Management) Added optional retrieveOtherBots parameter to getChatAdministrators extensions
    • (Chat Management) Added deleteUserMessageReaction and deleteActorChatMessageReaction extensions
    • (Chat Management) Added deleteAllUserMessageReactions and deleteAllActorChatMessageReactions extensions
    • (Chat Management) Added @Warning-marked catch-all deleteMessageReaction and deleteAllMessageReactions extensions
    • (Polls) Added media, membersOnly, countryCodes parameters to sendRegularPoll extension
    • (Polls) Added media, explanationMedia, membersOnly, countryCodes parameters to sendQuizPoll extension
    • (Managed Bots Access) Added getManagedBotAccessSettings extension in dev.inmo.tgbotapi.extensions.api.managed_bots
    • (Managed Bots Access) Added setManagedBotAccessSettings extension with userId and optional addedUserIds
    • (Personal Chat) Added getUserPersonalChatMessages extension returning List<ContentMessage<*>>
  • Behaviour Builder:
    • (Guest Mode) Added GuestMessageTriggers with onGuestRequestMessage trigger
    • (Guest Mode) Updated WaitContent, WaitContentMessage, WaitEditedContentMessage, WaitMediaGroup, WaitMediaGroupMessages, WaitCommandsMessages, WaitDeepLinks, WaitMention, WaitMentionMessage, ContentTriggers, EditedContentTriggers, MediaGroupMessagesTriggers, MediaGroupTriggers, MentionTriggers, DeepLinkHandling, MessageFilterExcludingMediaGroups for the unified ChatContentMessage hierarchy
    • (Live Photos) Added onLivePhoto, onEditedLivePhoto, onLivePhotoGalleryMessages, onLivePhotoGallery triggers
    • (Live Photos) Added onMentionWithLivePhotoContent/onTextMentionWithLivePhotoContent triggers
    • (Live Photos) Added waitLivePhoto, waitLivePhotoMessage, waitEditedLivePhoto, waitEditedLivePhotoMessage, waitLivePhotoGallery, waitLivePhotoGalleryMessages expectations
    • (Live Photos) Added onlyLivePhotoContentMessages utility
  • Utils:
    • (Guest Mode) Added guestMessageUpdateOrNull and related casts in ClassCastsNew
    • (Guest Mode) Updated MediaGroupContentMessageCreator and FlowsUpdatesFilter to support guest messages

33.2.0

Choose a tag to compare

@InsanusMokrassar InsanusMokrassar released this 13 Jun 08:17
  • Core:
    • Add ApiException as variant of BotException
    • Add classcasts for bots exceptions

33.1.0

Choose a tag to compare

@InsanusMokrassar InsanusMokrassar released this 19 Apr 08:51
  • Versions:
    • Kotlin: 2.3.10 -> 2.3.20
    • Serialization: 1.10.0 -> 1.11.0
    • Ktor: 3.4.1 -> 3.4.2
    • MicroUtils: 0.29.1 -> 0.29.2
    • KSLog: 1.6.0 -> 1.6.1

33.0.0

Choose a tag to compare

@InsanusMokrassar InsanusMokrassar released this 16 Apr 12:10

THIS UPDATE CONTAINS ADDING SUPPORT OF Telegram Bots API 9.6

THIS UPDATE CONTAINS BREAKING CHANGES

  • Core:
    • THIS IS BREAKING CHANGE MultipleAnswersPoll removed; RegularPoll now directly implements Poll
    • THIS IS BREAKING CHANGE allowMultipleAnswers renamed to allowsMultipleAnswers across poll types and requests
    • THIS IS BREAKING CHANGE QuizPoll.correctOptionId: Int? changed to correctOptionIds: List<Int>?
    • THIS IS BREAKING CHANGE PollOption is now a sealed interface with PollOption.Simple and PollOption.LatelyAdded subtypes; SimplePollOption removed
    • THIS IS BREAKING CHANGE PollAnswer.Anonymous.voterChat type changed from ChannelChat to PreviewPublicChat
    • THIS IS BREAKING CHANGE requestChannelReplyButton (group variant) renamed to requestGroupReplyButton
    • Added BotToken value class
    • Added SavePreparedKeyboardButton request with PreparedKeyboardButton and PreparedKeyboardButtonId types
    • Added GetManagedBotToken and ReplaceManagedBotToken requests
    • Added KeyboardButtonRequestManagedBot and RequestManagedBotKeyboardButton
    • Added ManagedBotCreated chat event and ManagedBotUpdated type with ManagedBotUpdate
    • Added PollOptionPersistentId value class
    • Added PollOptionAdded and PollOptionDeleted chat events
    • Added pollOptionId support in ReplyParameters (reply_to_poll_option_id)
    • Added canManageBots to ExtendedBot
    • Added allowsRevoting, shuffleOptions, allowAddingOptions, hideResultsUntilCloses, description/descriptionTextSources to poll types and send requests
    • Added chosenPersistentIds to PollAnswer
    • Added UsernameAtLessSerializer
    • Extended openPeriodPollSecondsLimit from 5..600 to 5..2628000
    • Fixed quiz poll serialization type (was incorrectly using regularPollType in quiz branch)
    • Fixed quiz poll explanation serialization (now correctly uses explanation/explanationTextSources)
    • Fixed SendQuizPoll correct option index range validation (off-by-one)
    • Several poll validation checks changed from throwing exceptions to logging warnings
  • API:
    • Added savePreparedKeyboardButton extensions
    • Added getManagedBotToken and replaceManagedBotToken extensions
    • Added optional pollOptionId parameter to reply/replyWith* extensions
    • Updated sendQuizPoll extensions with correctOptionIds, allowsMultipleAnswers, allowsRevoting, shuffleOptions, hideResultsUntilCloses, description parameters
    • Updated sendRegularPoll extensions with allowsRevoting, shuffleOptions, allowAddingOptions, hideResultsUntilCloses, description parameters
  • BehaviourBuilder:
    • Added onManagedBotCreated and onManagedBotUpdated triggers
    • Added onPollOptionAdded and onPollOptionDeleted triggers
    • Added waitManagedBotCreatedEvents and waitManagedBotUpdated expectations
    • Added waitPollOptionAddedEvents and waitPollOptionDeletedEvents expectations
    • Added ManagedBotUpdatedFilterByUser and ByUserManagedBotUpdatedMarkerFactory
  • Utils:
    • Added managedBotCreationLink formatting extensions
    • Added requestManagedBotButton to ReplyKeyboardBuilder
    • Added class casts for ManagedBotUpdate, ManagedBotCreated, PollOptionAdded, PollOptionDeleted
    • Removed MultipleAnswersPoll class casts
    • Updated raw poll accessors to match new model (allowsMultipleAnswers, correctOptionIds, explanation)
    • Regenerated class casts extensions
  • WebApps:
    • Added requestChat support for PreparedKeyboardButtonId
    • Fixed iconCustomEmojiId passing in BottomButton

32.0.0

Choose a tag to compare

@InsanusMokrassar InsanusMokrassar released this 08 Mar 09:32

THIS UPDATE CONTAINS BREAKING CHANGES

  • Version:
    • Kotlin: 2.2.21 -> 2.3.10
    • Kotlin Serialization: 1.9.0 -> 1.10.0
    • Ktor: 3.3.2 -> 3.4.1
    • KSP: 2.3.2 -> 2.3.6
    • MicroUtils: 0.26.9 -> 0.29.1
    • KSLog: 1.5.2 -> 1.6.0
  • Core + API:
    • BREAKING CHANGES: ALL METHODS THAT PREVIOUSLY RETURNED BOOLEAN NOW RETURNS UNIT
  • Core:
    • BREAKING CHANGE SetChatTitle init do not throw error in case when title.length is outside of chatTitleLength
    • BREAKING CHANGE SetStickerEmojiList init do not throw error in case when emojis.size is outside of emojisInStickerLimit
    • BREAKING CHANGE DeleteMessages init do not throw error in case when title is messageIds.size of deleteMessagesLimit
    • BREAKING CHANGE ForwardMessages init do not throw error in case when messageIds.size is outside of forwardMessagesLimit
    • BREAKING CHANGE CopyMessages init do not throw error in case when messageIds.size is outside of copyMessagesLimit
    • BREAKING CHANGE SwitchInlineQueryChosenChat init do not throw error in case when messageIds.size is outside of copyMessagesLimit
    • BREAKING CHANGE SetStickerKeywords init do not throw error in case when there are errors in keywords

31.2.0

Choose a tag to compare

@InsanusMokrassar InsanusMokrassar released this 04 Mar 14:52
  • Core:
    • Potentially fix #1027 - drop http request exceptions on getting updates
  • Core + API:
    • Add supportsStreaming in places it haven't been supported (fix of #1026)
      • PARTIALLY BREAKING CHANGE supportStreaming has been renamed to supportsStreaming