REPOSITORY / ScuroNeko/Laniakea
Releases
-
1.1.0
Stablereleased this
2026-08-12 16:34:44 +03:00 | 6 commits to main since this releasev1.1.0
Breaking Changes
- Fixed
Uploader.SendLivePhotoandUploader.SendLivePhotoWithContextto require both the live-photo video and its static image. The previous one-file signatures could not produce a validsendLivePhotorequest.
Bot API 10.1
- Added rich message receiving support:
tgapi.RichMessageonMessage.RichMessage(rich_message), the full set ofRichText*/RichBlock*wire types with official API names, andUnmarshalRichText/UnmarshalRichBlock/UnmarshalRichMessageparsers. Unknown text-bearing types retain their nested text through fallback wrappers while unmodeled fields are discarded. - Added rich message sending support:
tgapi.InputRichMessage,tgapi.SendRichMessageparams, andAPI.SendRichMessage/API.SendRichMessageWithContext. - Added rich message draft streaming:
API.SendRichMessageDraft/API.SendRichMessageDraftWithContextfor ephemeral ~30-second previews of partially generated messages. - Added rich message editing:
EditMessageText.RichMessage(InputRichMessage);Textis now omitted from the request when empty so rich-only edits are valid. - Added
tgapi.InputRichMessageContentfor rich content in inline query results. - Added join request query support:
User.SupportsJoinRequestQueries,ChatFullInfo.GuardBot,ChatJoinRequest.QueryID,API.AnswerChatJoinRequestQuerywithChatJoinRequestQueryResultconstants (JoinRequestApprove/JoinRequestDecline/JoinRequestQueue), andAPI.SendChatJoinRequestWebApp(plusWithContextvariants). - Added poll link media: the
tgapi.Linktype,PollMedia.Link, and the "link" type withURLonInputPollOptionMedia.
Bot API 10.2
- Added block-based rich-message sending with
InputRichMessage.Blocks, including animation, audio, photo, video, and voice-note input blocks. Thetgrichpackage provides matching media constructors with optional block captions. - Added
InputRichMessage.Mediafor media embedded in rich-message HTML or Markdown, with multipartattach://upload support. - Added multipart rich-message uploads through
Uploader.SendRichMessage. UseUploaderFile.SetAttachNameto match anattach://media reference; rich-message draft helpers reject direct uploads as required by Telegram. - Added ephemeral-message support: outgoing receiver and callback parameters, reply targets, message fields, edit and delete methods, and ephemeral bot commands. Added community service-message types and subscription update handling.
Added
- Added documented
tgrichconstructors and block types for building input rich messages. - Added
tgrich.BuildHTMLandtgrich.ToHTMLto validate input block trees, convert them to HTML rich messages, and collect URL,file_id, or multipart media references. - Added
MessageContext.RichAnswer(...)andMessageContext.RichAnswerKeyboard(...)for validating and sendingtgrichinput blocks. - Added
UpdateTypeSubscriptionrouting and normalized message, user, and chat context for guest messages, deleted business messages, anonymous poll answers, reaction counts, managed bots, chat boosts, and subscription updates. - Added webhook secret-format validation and the exported
ErrBotWebhookOptsSecretTokenInvalidsentinel.
Changed
AutoGenerateCommandsForScope(nil)now atomically replaces commands in Telegram's default scope without deleting the previous list first.- API debug logging now records redacted request JSON and response metadata instead of complete response bodies.
- Scene updates sharing a user or chat session key are serialized, and duplicate scene names from later plugins are skipped with a warning.
- Inline keyboard button builders now keep URL and callback actions mutually exclusive, and
InlineKeyboard.Getreturns independent markup data. NewBotno longer aliasesBotOpts.Prefixesor mutatesBotOpts.LoggerBasePath.- README requirements now match the module's Go 1.26 directive.
- Migrated the golangci-lint configuration to its v2 schema so the repository lint workflow runs again.
- Added missing Godoc for exported error methods, enum constants, and all public Bot API 10.1/10.2 fields introduced in this release.
Fixed
- Fixed JSON BotOpts environment placeholders corrupting or injecting JSON when values contain quotes, backslashes, or control characters.
- Preserved checkbox state when converting list items to ordered lists and made generated HTML attribute ordering deterministic.
- Added validation for rich-block type discriminators, heading sizes, list fields, table cells, map parameters, and media values.
- Fixed generated webhook secrets using padded Base64 characters that Telegram rejects, stopped logging generated secrets, and added HTTP read and idle timeouts to the webhook server.
- Fixed negative group and channel IDs receiving global rather than per-chat
retry_aftercooldowns. - Fixed rejected per-chat requests consuming global rate-limit capacity and draft construction consuming an extra rate-limit token before the API request.
- Fixed subscription updates being decoded as
UpdateTypeUnknown. - Fixed rich-text and rich-block decoding silently accepting malformed typed fields or a top-level
nullrich-text value. - Fixed
tgrich.BuildHTMLdisabling Telegram entity detection and accepting the draft-only thinking block;BuildDraftHTMLnow provides the explicit draft path. - Fixed
tgrich.BuildHTMLsilently losing explicit bank-card, mention, hashtag, cashtag, and bot-command values when their visible text differs. - Fixed API debug logs exposing webhook, payment, callback, passport, and managed-bot secrets.
- Fixed panics and nil callbacks in asynchronous middleware terminating the process; failures now reach the logger and observer error stream.
- Fixed multipart helpers attempting direct file uploads for rich-message drafts, which Telegram does not support; they now return
ErrRichMessageDraftUploadUnsupported. - Fixed draft ID zero values and collisions overwriting tracked drafts, nil draft APIs panicking, and draft entity slices aliasing caller memory.
- Fixed scene session payloads and returned inline keyboard markup aliasing mutable internal slices.
- Recovered panics from runner callbacks so they are reported through normal runner and error observer events instead of terminating the process.
Tests
- Added JSON regression coverage for rich-message embedded media and ephemeral send, edit, and delete parameters.
- Added regression coverage for escaped environment placeholders and both required
sendLivePhotomultipart fields. - Added regression coverage for API log redaction, same-session scene serialization, duplicate scene registration, async middleware failures, and rich entity preservation.
- Added rich HTML renderer coverage for all input block and media types, multipart references, field validation, and Telegram's text, block, nesting, media, and table-width limits.
- Added regression coverage for webhook token syntax, update context normalization, subscription routing, rate-limit capacity, draft ID collisions, runner panics, scene and keyboard aliasing, command replacement, and malformed rich JSON.
Full Changelog: v1.0.2...v1.1.0
Downloads
- Fixed