REPOSITORY / ScuroNeko/Laniakea

Releases

RELEASES REPOSITORY
  • v1.1.0 f03a081ed6

    1.1.0
    Golang lint / lint (pull_request) Successful in 1m20s
    Golang lint / lint (push) Successful in 4m8s
    Stable

    ScuroNeko released this 2026-08-12 16:34:44 +03:00 | 6 commits to main since this release

    v1.1.0

    Breaking Changes

    • Fixed Uploader.SendLivePhoto and Uploader.SendLivePhotoWithContext to require both the live-photo video and its static image. The previous one-file signatures could not produce a valid sendLivePhoto request.

    Bot API 10.1

    • Added rich message receiving support: tgapi.RichMessage on Message.RichMessage (rich_message), the full set of RichText*/RichBlock* wire types with official API names, and UnmarshalRichText/UnmarshalRichBlock/UnmarshalRichMessage parsers. Unknown text-bearing types retain their nested text through fallback wrappers while unmodeled fields are discarded.
    • Added rich message sending support: tgapi.InputRichMessage, tgapi.SendRichMessage params, and API.SendRichMessage/API.SendRichMessageWithContext.
    • Added rich message draft streaming: API.SendRichMessageDraft/API.SendRichMessageDraftWithContext for ephemeral ~30-second previews of partially generated messages.
    • Added rich message editing: EditMessageText.RichMessage (InputRichMessage); Text is now omitted from the request when empty so rich-only edits are valid.
    • Added tgapi.InputRichMessageContent for rich content in inline query results.
    • Added join request query support: User.SupportsJoinRequestQueries, ChatFullInfo.GuardBot, ChatJoinRequest.QueryID, API.AnswerChatJoinRequestQuery with ChatJoinRequestQueryResult constants (JoinRequestApprove/JoinRequestDecline/JoinRequestQueue), and API.SendChatJoinRequestWebApp (plus WithContext variants).
    • Added poll link media: the tgapi.Link type, PollMedia.Link, and the "link" type with URL on InputPollOptionMedia.

    Bot API 10.2

    • Added block-based rich-message sending with InputRichMessage.Blocks, including animation, audio, photo, video, and voice-note input blocks. The tgrich package provides matching media constructors with optional block captions.
    • Added InputRichMessage.Media for media embedded in rich-message HTML or Markdown, with multipart attach:// upload support.
    • Added multipart rich-message uploads through Uploader.SendRichMessage. Use UploaderFile.SetAttachName to match an attach:// 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 tgrich constructors and block types for building input rich messages.
    • Added tgrich.BuildHTML and tgrich.ToHTML to validate input block trees, convert them to HTML rich messages, and collect URL, file_id, or multipart media references.
    • Added MessageContext.RichAnswer(...) and MessageContext.RichAnswerKeyboard(...) for validating and sending tgrich input blocks.
    • Added UpdateTypeSubscription routing 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 ErrBotWebhookOptsSecretTokenInvalid sentinel.

    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.Get returns independent markup data.
    • NewBot no longer aliases BotOpts.Prefixes or mutates BotOpts.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_after cooldowns.
    • 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 null rich-text value.
    • Fixed tgrich.BuildHTML disabling Telegram entity detection and accepting the draft-only thinking block; BuildDraftHTML now provides the explicit draft path.
    • Fixed tgrich.BuildHTML silently 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 sendLivePhoto multipart 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