36.0.0
THIS UPDATE CONTAINS SUPPORT OF TELEGRAM BOTS API 10.2
Breaking changes:
RichBlockTableCell.alignnow uses the string-serializedRichBlockTableCellAlignsealed hierarchy (Left,Center, orRight) instead ofStringRichBlockTableCell.valignnow uses the string-serializedRichBlockTableCellVAlignsealed hierarchy (Top,Middle, orBottom) instead ofStringRichBlockTableCellis now a sealed interface withHeaderandRegularimplementations; the input table DSL usesheaderCellandcellrespectivelyInputRichBlockListItemis now a sealed interface withOrderedandUnorderedimplementations; ordered items require a non-nullvalueand typedLabelType, whileLabelType.Decimalsis the default;InputRichBlocksBuildernow exposes separateorderedListandunorderedListDSL functions with matching item buildersReplyParametersis now a sealed interface with nestedReplyParameters.ChatandReplyParameters.Ephemeralimplementations; overloadedReplyParameters(...)companion factories construct both regular-message and ephemeral-message variants- The 4 group-family message implementations (
CommonGroupContentMessageImpl,CommonForumContentMessageImpl,CommonChannelDirectMessagesContentMessageImpl,CommonSuggestedChannelDirectMessagesContentMessageImpl) gained trailingreceiverUser/ephemeralMessageIdprimary-constructor parameters (defaulted tonull) ��� positional construction of these classes must be updated reply(to = ...)overloads for the 13 ephemeral-capable senders (see below) now detect an ephemeraltotarget (to is PossiblyEphemeralMessage && to.ephemeralMessageId != null) and automatically address the reply throughephemeral_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-nullephemeralMessageId
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-serializedRichBlockTableCellVAlignhierarchy and migrated table-cell vertical alignment fromStringtoRichBlockTableCellVAlign - (
Rich Messages) Added the raw-string-serializedRichBlockTableCellAlignhierarchy and migrated table-cell alignment fromStringtoRichBlockTableCellAlign - (
Rich Messages) SplitRichBlockTableCellinto header/regular variants with a shared flat surrogate serializer; addedheaderCellto the input table DSL - (
Rich Messages) Addedh1throughh6shortcuts for plain and rich-text headings inInputRichBlocksBuilder - (
Rich Messages) Reworked the input table DSL to build cells through nestedtable { row { cell(...) { } } }builders - (
Rich Messages) Replaced the flatInputRichBlockListItemdata class with ordered/unordered variants, added the string-serializedLabelTypehierarchy (A,a,I,i,1), and split the list DSL intoInputRichBlockOrderedListBuilder/InputRichBlockUnorderedListBuilder - (
Rich Messages) AddedInputRichBlockhierarchy with all 21InputRichBlock*types (mirroring the receivedRichBlock*hierarchy and reusingRichText/RichBlockCaption/RichBlockTableCell), the label-lessInputRichBlockListItemand theInputRichBlockSerializer; everyInputRichBlockexposessubBlocksnavigation - (
Rich Messages) AddedTelegramMediaVoiceNote(InputMediaVoiceNote) and theRichMessageMemberTelegramMediamarker interface implemented by it,TelegramMediaAnimation,TelegramMediaAudio,TelegramMediaPhotoandTelegramMediaVideo; addedVoiceFile.toTelegramMediaVoiceNoteconverters - (
Rich Messages) AddedInputRichMessageMediatype (media referenced fromInputRichMessage.html/.markdownviatg://photo?id=,tg://video?id=andtg://audio?id=links) - (
Rich Messages)InputRichMessagegainedblocksandmediafields ("exactly one ofhtml,markdownorblocksmust be used") and theInputRichMessageBlocksfactory;InputRichMessageHTML/InputRichMessageMarkdowngained a trailingmediaparameter - (
Rich Messages) Added Rich Messages input DSL buildersbuildInputRichBlocks/InputRichBlocksBuilder, typed ordered/unordered list builders and theInputRichMessageBlocks { }builder overload (marked with the@RichTextDslDSL marker) - (
Rich Messages)SendRichMessagenow supportsattach://upload of new files referenced fromInputRichMessage.blocks/.media;SendRichMessageDraftnow rejects rich messages that require direct file upload (unsupported by the method) - (
Ephemeral Messages) AddedEphemeralMessageIdvalue class,PossiblyEphemeralMessage(receiverUser/ephemeralMessageId) andEphemeralMessageAction(receiverUserId/ephemeralMessageId) abstractions - (
Ephemeral Messages)RawMessageparsesreceiver_user/ephemeral_message_id; the 4 group-familyCommon*ContentMessagetypes (CommonGroupContentMessage,CommonForumContentMessage,CommonChannelDirectMessagesContentMessage,CommonSuggestedChannelDirectMessagesContentMessage, via the sharedPotentiallyFromUserGroupContentMessage) now also implementPossiblyEphemeralMessage - (
Ephemeral Messages)BotCommandgained theisEphemeralfield - (
Ephemeral Messages)ReplyParametersbecame a sealed interface with nestedChatandEphemeralimplementations and a shared surrogate-backed serializer preserving the flat Bot API JSON shape; added theMessage.ephemeralReplyParametersOrNull()/Message.ephemeralReplyReceiverUserIdOrNullhelpers used by thereply(to = ...)smart-branch - (
Ephemeral Messages)ReplyParameters.EphemeralandMessage.ephemeralReplyParametersOrNull()support and forwardallowSendingWithoutReply,checklistTaskId, andpollOptionIdtogether withephemeralMessageId - (
Ephemeral Messages) AddedreceiverUserId/callbackQueryIdparams (via the newOptionallyEphemeralSendRequest) to the 13 ephemeral-capable send requests:SendTextMessage,SendContact,SendLocation(Static/Live),SendVenue,SendPhotoData,SendLivePhotoData,SendAudioData,SendDocumentData,SendVideoData,SendAnimationData,SendVoiceData,SendVideoNoteData,SendStickerByFileId - (
Ephemeral Messages) AddedEditEphemeralMessageText/EditEphemeralMessageMedia/EditEphemeralMessageCaption/EditEphemeralMessageReplyMarkupandDeleteEphemeralMessagerequests (all returnUnit, mirroring the inline-message edit family);EditEphemeralMessageMediarejectsMultipartFilemedia (new file upload is not supported for ephemeral edits) - (
Ephemeral Messages) AddedEphemeralChatId(IdChatIdentifier, carryingchatId/receiverUser/ephemeralMessageId) and theChatIdentifier.receiverUser/ChatIdentifier.ephemeralMessageIdextensions (mirroringChatIdentifier.threadId);FullChatIdentifierSerializergained thechatId/eph/receiverUserChatId/ephemeralMessageIdstring format. The nullablereceiverUserIdparam of the 13 ephemeral-capable send requests still defaults from the passedchatIdwhen it is anEphemeralChatId;DeleteEphemeralMessageandEditEphemeralMessageText/EditEphemeralMessageCaption/EditEphemeralMessageMedia/EditEphemeralMessageReplyMarkupinstead keepreceiverUserId/ephemeralMessageIdREQUIRED on their primary constructor/factory form, gainingEphemeralChatId-taking secondary constructors/factory overloads that source both params from the identifier (throwingIllegalArgumentExceptionif it carries noephemeralMessageId) - (
Communities) AddedCommunityIdvalue class andCommunitytype (id/name) - (
Communities) AddedCommunityChatAdded(community) andCommunityChatRemoved(fieldless) chat events (CommonEvent);RawMessageparsescommunity_chat_added/community_chat_removed - (
Communities) Addedcommunityfield toExtendedChat(ChatFullInfo.community), parsed forExtendedChannelChatImpl,ExtendedGroupChatImpl,ExtendedSupergroupChatImpl,ExtendedForumChatImpl,ExtendedChannelDirectMessagesChatImplandExtendedBot - (
Bot Subscriptions) AddedBotSubscriptionUpdated(user,invoicePayload,state) andBotSubscriptionUpdatedUpdate;stateis modeled as the typed sealedBotSubscriptionUpdated.State(Canceled/Active/Failed, with anUnknownfallback), mirroringTransactionType - (
Bot Subscriptions)RawUpdateparses the newsubscriptionfield; addedUPDATE_SUBSCRIPTIONtoALL_UPDATES_LIST_WITHOUT_REACTIONS;FlowsUpdatesFiltergainedbotSubscriptionUpdatedUpdatesFlow
- (
API:- (
Ephemeral Messages) ThreadedreceiverUserId/callbackQueryIdthrough thesendXxx/send/reply/replyWithXxxextensions for the 13 ephemeral-capable senders (send/Sends.kt,send/Replies.kt,send/RepliesWithChatsAndMessages.ktand their per-type extension files);reply(to = ...)now automatically sends an ephemeral reply whentois itself ephemeral (see Breaking changes) - (
Ephemeral Messages) Ephemeral-capablereply(to = ...)overloads gainedreplyToEphemeralMessageId, defaulting fromPossiblyEphemeralMessage.ephemeralMessageId; direct and dispatcher overloads forward the explicit target intoephemeralReplyParametersOrNull - (
Ephemeral Messages) Added 48 ephemeral-onlyreply/replyWithXxxoverloads inRepliesWithEphemeral.ktwithout aChatMessage; each overload requiresreplyInChatId,receiverUserId, andreplyToEphemeralMessageId, with complete content-form and dispatcher parity across the 13 ephemeral-capable senders - (
Ephemeral Messages) AddededitEphemeralMessageText/editEphemeralMessageMedia/editEphemeralMessageCaption/editEphemeralMessageReplyMarkupanddeleteEphemeralMessageTelegramBotextensions (the latter also accepts aPossiblyEphemeralMessagedirectly) - (
Ephemeral Messages) Added explicitreplyToEphemeral/replyToEphemeralWithXxxTelegramBotextensions for the 13 ephemeral-capable senders, replying to an ephemeral message bychatId/ephemeralMessageIdwithout requiring the originalMessageobject - (
Ephemeral Messages)receiverUserId/ephemeralMessageIdparams of the edit/delete/replyToEphemeral*extensions remain REQUIRED on thechatId: ChatIdentifier/chat: Chatforms; eachchatId: ChatIdentifierform additionally gained a convenience overload takingchatId: EphemeralChatId(droppingreceiverUserId/ephemeralMessageId) that sources both from the identifier, throwingIllegalArgumentExceptionif it carries noephemeralMessageId(thechat: Chatforms got no such overload, sinceChat.idis statically only anIdChatIdentifier);Replies.kt'sreceiverUserIddefault now also checksreplyInChatId.receiverUserbefore falling back toto.ephemeralReplyReceiverUserIdOrNull - (
Ephemeral Messages) Not covered by this iteration (follow-up):createResend/ResendMessagedo not carry ephemeral fields (a resend is always a regular message);handleLiveLocationand the genericreply(mediaFile = ...)/reply(content = ...)dispatchers inRepliesWithChatsAndMessages.kt'scopyMessage/live-location branches are unaffected;behaviour_buildertriggers/waiters gained no ephemeral-specific helpers
- (
BehaviourBuilder:- (
Communities) AddedonCommunityChatAdded/onCommunityChatRemovedtriggers - (
Communities) AddedwaitCommunityChatAdded/waitCommunityChatRemovedandwaitCommunityChatAddedEventsMessages/waitCommunityChatRemovedEventsMessagesexpectations - (
Bot Subscriptions) AddedonBotSubscriptionUpdatedtrigger,waitBotSubscriptionUpdatedexpectation andByUserBotSubscriptionUpdatedMarkerFactory
- (
Utils:- (
Rich Messages) Added generated class-cast extensions (*OrNull/*OrThrow/if*) for theInputRichBlockhierarchy,TelegramMediaVoiceNoteandRichMessageMemberTelegramMedia - (
Ephemeral Messages) Added generated class-cast extensions (*OrNull/*OrThrow/if*) forEphemeralChatIdandPossiblyEphemeralMessage - (
Communities) Added generated class-cast extensions (*OrNull/*OrThrow/if*) forCommunityChatAddedandCommunityChatRemoved - (
Bot Subscriptions) Added class casts forBotSubscriptionUpdatedUpdate(whenBotSubscriptionUpdatedUpdate/asBotSubscriptionUpdatedUpdate/requireBotSubscriptionUpdatedUpdate); regenerated class casts extensions (botSubscriptionUpdatedUpdateOrNull/OrThrow,botSubscriptionUpdatedOrNull/OrThrow)
- (