REPOSITORY / ScuroNeko/Laniakea

Releases

RELEASES REPOSITORY
  • 2.0.0 RC3
    Golang lint / lint (push) Successful in 4m11s
    Pre-Release

    ScuroNeko released this 2026-10-08 10:49:29 +03:00 | 3 commits to dev since this release

    v2.0.0-rc.3 (2026-10-08)

    Added

    • Added MultiObserver and NewMultiObserver to forward observer events synchronously or asynchronously to multiple observers.

    Changed

    • Migrated JSON encoding and decoding to encoding/json/v2, including stricter UTF-8 and duplicate-key handling. Nil slices and maps now encode as empty arrays and objects when included; optional scalar zero values and nil pointers remain omitted in Telegram types.
    • Webhook status responses now use compact JSON.
    • Prepared version metadata for v2.0.0-rc.3.
    • Documented Telegram JSON presence and empty-value rules in English and Russian.

    Breaking changes

    • Normalized optional primitive fields across Telegram user/chat, administrator/business rights, invite, sticker, story/profile/media, callback, and polling types: true-only flags and values with equivalent absent/zero semantics are now scalars. Keyboard filters, getMe-only capabilities, variant-specific member fields, and meaningful zero values retain pointers.
    • Changed poll anonymity/revoting, inline-query cache duration, promotion restriction rights, inherited chat permissions, copied captions, and edited topic icons to pointers to distinguish omission from explicit false, zero, or empty strings. Gift conversion/transfer costs and the next user-rating threshold now preserve unavailable values with pointers. See the paired JSON migration guides.
    • Changed RichTextUnknown.Raw and RichBlockUnknown.Raw from json.RawMessage to jsontext.Value.

    Fixed

    • Restored Telegram defaults for anonymous polls, revoting, inline-query caching, channel promotion, and inherited chat permissions while allowing explicit overrides. Empty copied captions and topic icons can now be removed deliberately.
    • Preserved explicit false media permissions to avoid Telegram legacy permission inheritance.
    • Preserved explicitly empty allowed_updates lists in JSON and multipart requests while omitting nil lists, so callers can restore Telegram's default update selection.
    • Preserved explicitly supplied empty objects and string pointers, including disabled buttons, unrestricted poll requests, and empty rich-button inline queries.
    • Aligned multipart omitempty and omitzero handling with JSON v2 and skipped unexported fields.
    • Completed JSON v2 raw-value validation and test imports.

    Tests

    • Added JSON and multipart regression coverage for absent fields, empty arrays and objects, empty string pointers, required nil collections, scalar defaults, inherited permissions, primitive overrides, and absent versus zero response values.

    What's Changed

    Full Changelog: v2.0.0-rc.2...v2.0.0-rc.3

    Downloads
  • v2.0.0 RC 2
    Golang lint / lint (push) Failing after 2m42s
    Pre-Release

    ScuroNeko released this 2026-09-24 11:39:31 +03:00 | 1 commits to main since this release

    v2.0.0-rc.2 (2026-09-24)

    Added

    • Added explicit HTTP, HTTPS, SOCKS5, and SOCKS5H proxy configuration for bot-managed Telegram API clients, including authenticated proxy settings in JSON bot configuration files.

    Changed

    • Prepared version metadata for v2.0.0-rc.2 and updated the lint workflow to use the runner-provided Go and golangci-lint toolchains.

    Tests

    • Added proxy configuration coverage for authenticated round trips, default ports, invalid settings, client timeouts, and transport isolation from later option mutations.

    What's Changed

    Full Changelog: v2.0.0-rc.1...v2.0.0-rc.2

    Downloads
  • v2.0.0 RC 1
    Golang lint / lint (push) Failing after 1m37s
    Pre-Release

    ScuroNeko released this 2026-09-08 23:21:38 +03:00 | 6 commits to dev since this release

    v2.0.0-rc.1 (2026-09-08)

    Added

    • Added Bot API 10.3 rich buttons: RichMessageButton, RichTextButton, RichBlockButtons, and InputRichBlockButtons, including inline-query chat selection, login, clipboard, and disabled actions. Empty inline queries are preserved through pointer fields; RichMessageButtonStyleLink supports borderless callback buttons.
    • Added incoming and outgoing expandable block quotations and document blocks, with tgrich.Button, Buttons, ButtonsWithAlign, ExpandableBlockquote, ExpandableBlockquoteWithCredit, Document, and DocumentWithCaption helpers.
    • Added compact rich tables through IsCompact and RichTable.SetCompact, including JSON decoding and HTML rendering.
    • Added rich-button validation for a single action, permitted label entities and styles, callback byte limits, copy-text length, row size, and alignment. Invalid values return ErrRichInvalidButton from tgrich builders.
    • Added HTML rendering for rich buttons, expandable quotations, and documents. Document media is collected into InputRichMessage.Media with tg://document?id= references and supports multipart attachments through the existing rich-message uploader.
    • Added EphemeralMessageParameters, including ReplaceCallbackQueryMessage, to JSON and multipart send parameters for text, rich messages, animation, audio, documents, live photos, photos, stickers, video, video notes, voice, contacts, locations, and venues. Ephemeral media editing now supports multipart attachments through Uploader.EditEphemeralMessageMedia.
    • Added RichMessage to EditEphemeralMessageText and ShowCaptionAboveMedia to EditEphemeralMessageCaption.
    • Added CanStop and KeepOnStop to message and rich-message draft parameters. Stopped-generation updates are decoded as UpdateTypeMessageGenerationStopped and expose their chat through normalized message context.
    • Added disabled inline buttons and SetDisabled, plus ForceReply support on specialized inline and reply keyboard markup.
    • Added CommunityChatJoined service messages; UniqueGiftInfo.Text, Entities, and IsPrivate; and CanSendWelcomeMessages to administrator members, rights, and promotion parameters.
    • Added RichTextUnknown and RichBlockUnknown to preserve unrecognized Telegram rich objects without losing fields.
    • Added explicit InlineKeyboard.SetUnlimitedRows configuration.

    Breaking changes

    • Changed the Go module and import path to git.scuroneko.dev/scuroneko/laniakea/v2, raised the minimum Go version to 1.27, and removed the v1-only retraction directive.
    • PollAnswer.User and VoterChat are now pointers; removed VoterUser and VoterChatInfo. Update-context normalization and tests use the pointer fields.
    • RunnerFn and NewRunner now require callbacks with context.Context; removed ContextRunnerFn and NewContextRunner.
    • InlineKeyboard.Get now validates and returns (*tgapi.ReplyMarkup, error); removed GetValidated and keyboard-level Validate. Message-context helpers reject invalid keyboards before sending or editing. Previously built rows exceeding a subsequently lowered row limit now fail final validation.
    • CallbackData.Encode now returns (string, error) and validates encoding and payload length; removed EncodeValidated.
    • Moved custom request execution from TelegramRequest.Do / DoWithContext to API.Do / DoWithContext, and from UploaderRequest methods to the corresponding Uploader methods.
    • Renamed ChatFullInfo.AvailableReaction to AvailableReactions, ReplyParameters.QuoteParsingMode to QuoteParseMode, and InputChecklist.OtherCanAddTasks / OtherCanMarkTasksAsDone to OthersCanAddTasks / OthersCanMarkTasksAsDone; JSON keys remain unchanged.
    • Removed DeleteAllMessageReactionWithContext; use DeleteAllMessageReactionsWithContext.
    • The JSON and multipart send parameter structs listed above replace top-level ReceiverUserID and CallbackQueryID with EphemeralMessageParameters.
    • UnmarshalRichMessage now requires a non-null blocks array. Unknown rich objects use lossless raw wrappers instead of lossy text wrappers or errors.
    • Removed the unbounded API.GetFileByLink and GetFileByLinkWithContext; use GetFileByLinkLimit* with an explicit byte limit or OpenFileByLink* for streaming.
    • Non-positive inline-keyboard row limits are invalid by default; call SetUnlimitedRows to disable automatic wrapping explicitly.

    Changed

    • Prepared the declared version and user-agent metadata for v2.0.0-rc.1.
    • Updated English and Russian README runner and keyboard examples for the final v2 contracts, and generalized the prerelease policy for the v2 RC cycle.

    Fixed

    • Fixed nested rich-text validation skipping children of formatting and link entities, which could bypass text-size and nesting limits.

    Tests

    • Migrated runner, poll-voter, keyboard, message-context, and wire-format tests to the new contracts.
    • Added rich-button action round trips, malformed-input and nesting cases, row and callback boundaries, HTML escaping, compact tables, expandable quotations, document media, multipart attachments, draft-upload coverage, Bot API 10.3 wire fields, stopped-generation routing, strict root parsing, lossless unknown objects, bounded downloads, explicit unlimited rows, and compile-focused v1-to-v2 migration coverage.

    What's Changed

    Full Changelog: v1.2.0...v2.0.0-rc.1

    Downloads
  • v1.2.0 24040fe164

    1.2.0
    Golang lint / lint (push) Successful in 58s
    Golang lint / lint (pull_request) Successful in 13m10s
    Stable

    ScuroNeko released this 2026-08-20 11:08:45 +03:00 | 4 commits to main since this release

    v1.2.0

    Added

    • Added cancelable background runners through ContextRunnerFn and NewContextRunner; existing RunnerFn and NewRunner remain available for compatibility.
    • Added validated inline-keyboard APIs: InlineKeyboardButtonBuilder.Validate/Build, InlineKeyboard.Validate/GetValidated, and CallbackData.EncodeValidated, with typed errors for invalid actions, callback-data length, and oversized rows.
    • Added bounded file-download helpers GetFileByLinkLimit and GetFileByLinkLimitWithContext with ErrFileTooLarge; existing unbounded and streaming helpers remain available.
    • Added strict root rich-message parsing through UnmarshalRichMessageStrict and structural rich JSON depth/node limits with ErrRichJSONDepth and ErrRichJSONNodes.
    • Added APIOpts.SetMaxRetries for Telegram 429 responses. Automatic JSON and multipart retries now default to at most three attempts after the initial request and return ErrRetryLimit when exhausted.
    • Added SetChatPhotoWithContext and the correctly pluralized DeleteAllMessageReactionsWithContext; the old singular compatibility alias remains deprecated until v2.
    • Added PollAnswer.VoterUser and PollAnswer.VoterChatInfo presence helpers without changing the v1 value-field layout.
    • Added typed runtime errors for invalid scene actions, nil handlers, recovered handler panics, oversized Telegram responses, and recovered worker-pool task panics.
    • Added CommandScopeUpdateError and command-generation validation errors so callers can inspect invalid commands, duplicate names, invalid descriptions, and partially updated Telegram scopes.
    • Added rich-message editing helpers MessageContext.EditCallbackRich, MessageContext.UpsertKeyboardRich, AnswerMessage.EditRich, and AnswerMessage.EditRichKeyboard, plus AnswerMessage.RichHTML for rendered rich content.
    • Added NewBotWithAPI for constructing a bot with a preconfigured, injectable Telegram API client.

    Changed

    • Runtime observer callbacks now execute asynchronously in enqueue order on one bounded dispatcher instead of blocking update handlers and scene locks. Queue overflow drops events with sampled warnings, observer panics remain isolated, and shutdown cancels callback contexts, drains queued events, and reports callbacks that ignore cancellation.
    • Scene routing now holds a lock only for the active session key; updates without an active scene and unrelated user sessions in the same chat remain concurrent.
    • Multipart uploads now encode request bodies as streams instead of building a second complete in-memory copy for every attempt.
    • Logger replacement and app-data logger writer registration now follow the bot configuration freeze, reject nil values safely, and install bot-token redaction before publishing replacement loggers.
    • README and README_RU now document context runners, injectable API clients, bounded retries and downloads, streaming multipart uploads, keyboard validation, and asynchronous observer delivery.
    • Version metadata now reports v1.2.0.

    Fixed

    • Fixed HTTP transport errors exposing the bot token through Bot API request and file-download URLs while preserving error-chain inspection.
    • Fixed per-chat rate-limiter lifecycle races with concurrent cleanup, cooldown waits ignoring a later extension, shorter 429 locks replacing longer locks, and busy chats consuming global capacity before obtaining chat capacity.
    • Fixed scene AsUserError values not reaching users and producing duplicate observer errors; scene step, command, payload, and message-fallback errors now follow one consistent error path.
    • Fixed nil and panicking command, payload, update, message-fallback, scene, and middleware callbacks breaking handler/observer lifecycles. Panics are recovered per invocation and matching finish/error events are emitted.
    • Fixed asynchronous middleware error events and policy events bypassing the runtime observer dispatcher.
    • Fixed Telegram MarkdownV2 custom emoji syntax, multiline expandable blockquotes, code/pre escaping, and unsafe code-fence language strings.
    • Fixed MessageContext.BindArgs accepting values outside the destination integer or floating-point width.
    • Fixed empty successful draft flushes leaving stale drafts in DraftProvider.
    • Fixed generated command descriptions outside Telegram's 1–256-character range, duplicate command names across plugins, trailing usage whitespace, and silent partial multi-scope updates.
    • Fixed inline keyboard auto-wrap after reducing maxRow; legacy non-positive unlimited rows remain compatible for v1.
    • Fixed Telegram API responses larger than 10 MiB being silently truncated before JSON parsing; they now return ErrResponseTooLarge.
    • Fixed unknown SceneAction values being treated as a normal unhandled result.
    • Fixed worker-pool task panics terminating a worker and leaving the caller without a result.
    • Fixed zero or negative Telegram retry_after values causing a tight retry loop.
    • Fixed Telegram JSON wire names for provider_payment_charge_id, owned_gift_id, others_can_add_tasks, others_can_mark_tasks_as_done, available_reactions, and quote_parse_mode.
    • Fixed MessageContext text, photo, caption, rich-message, and chat-action helpers omitting business connection identifiers; message-backed helpers now also reject missing chats instead of panicking, while inline edits remain supported without a chat-backed message.
    • Fixed chat-admin, chat-creator, and bot-admin policies ignoring cancellation and deadlines from the active MessageContext.
    • Fixed command parsing treating tabs and newlines as part of command names and matching addressed bot usernames case-sensitively.
    • Fixed nested RichTextArray values bypassing rich-message depth validation and renderer limits.
    • Fixed polling panics being reported only through telemetry while RunWithContext returned success.
    • Fixed asynchronous middleware outliving the bot runtime and normal middleware denials being reported as internal handler errors.
    • Fixed caller-owned or aliased bot loggers being closed by the framework, bot-owned aliases being closed more than once, and replaced internal loggers leaking resources.
    • Fixed configuration codecs and JSON option encoding panicking on nil inputs.

    Documentation

    • Added field-level Godoc for the complete exported API surface, including official Telegram Bot API optionality, ranges, formats, and field semantics. The repository-wide AST audit now reports no undocumented exported declarations or struct fields.
    • Corrected draft-provider Godoc to avoid promising cryptographic unpredictability from math/rand/v2 IDs.
    • Marked v1 compatibility surfaces that may change in v2: PollAnswer voter pointers, context-required runners, error-returning keyboard builders, strict rich-message parsing, lossless unknown rich types, bounded downloads, compatibility aliases, and corrected public field names.
    • Clarified that drop-overflow mode rejects outgoing API requests, one-shot asynchronous runners are awaited during shutdown, and pending uploads are drained by the shared API client.

    CI

    • Pinned the lint workflow to Go 1.26.6, golangci/golangci-lint-action@v9.0.0, and golangci-lint v2.12.2 for reproducible analysis.

    Tests

    • Added regression coverage for limiter concurrency and cooldown behavior, scene lock scope, all scene handler error paths, polling, handler, and worker panics, asynchronous observer delivery, cancellation, and bounded shutdown, asynchronous middleware lifecycle, logger ownership, runner and policy cancellation, nil configuration inputs, draft cleanup, command parsing, command validation and partial scopes, keyboard byte boundaries and rows, MarkdownV2 vectors, numeric binding boundaries, rich JSON and renderer depth limits, strict rich roots, rich-message editing, business-message helpers and photo replacement, bounded file downloads, retry caps, streaming multipart replay, and corrected Telegram wire keys.

    Full Changelog: v1.1.0...v1.2.0

    Downloads
  • 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
  • v1.0.2 38309e74f6

    1.0.2
    Golang lint / lint (push) Successful in 1m40s
    Stable

    ScuroNeko released this 2026-07-08 12:02:38 +03:00 | 12 commits to dev since this release

    v1.0.2

    Fixed

    • Fixed long-polling stopping permanently when the HTTP client's internal timeout fired. The polling loop was checking errors.Is(err, context.DeadlineExceeded), which matched HTTP client timeout errors (*url.Error wraps context.DeadlineExceeded), causing the goroutine to exit as if the bot context was canceled. The check is now ctx.Err() != nil so only a real context cancellation stops polling.
    • Fixed the HTTP client timeout (45 s) being too close to the long-poll getUpdates timeout (30 s default), leaving insufficient margin for connection setup and response transfer. The client timeout is now derived from the configured PollTimeout plus a 60-second buffer.

    What's Changed

    Full Changelog: v1.0.1...v1.0.2

    Downloads
  • v1.0.1 c2f6406819

    1.0.1
    Golang lint / lint (pull_request) Successful in 2m59s
    Golang lint / lint (push) Successful in 2m56s
    Stable

    ScuroNeko released this 2026-06-11 13:34:48 +03:00 | 13 commits to dev since this release

    Fixed

    • Fixed webhook always accepting unauthenticated requests when SecretToken is not configured. A cryptographically random 32-byte token is now generated automatically when SecretToken is empty, so the webhook endpoint is always authenticated. The generated token is logged as a warning so the operator can record it.
    • Fixed tgapi.NewAPI and tgapi.NewUploader not installing token redaction on their managed loggers. The bot token is now masked as <TOKEN> in debug output even when the tgapi package is used standalone without the laniakea.Bot wrapper.

    What's Changed

    • v0.3.10 in #7
    • v0.3.2 in #3

    Contributors

    New Contributors

    Full Changelog: v1.0.0...v1.0.1

    Downloads
  • v1.0.0 5514665625

    1.0.0
    Golang lint / lint (pull_request) Successful in 2m42s
    Golang lint / lint (push) Successful in 1m20s
    Stable

    ScuroNeko released this 2026-05-20 13:23:31 +03:00 | 18 commits to main since this release

    Laniakea v1.0.0

    First stable release. The public API is now frozen under semantic versioning — future breaking changes will increment the major version.

    Highlights

    • Telegram Bot API 10.0 — full support for new types, methods, and update kinds.
    • Webhook runtime — RunWebhookWithContext(...) owns the HTTP server, update queue, worker pool, and runners, matching the polling runtime model exactly.
    • Scenes — multi-step conversation flows with scoped sessions, step handlers, scene-local commands and payloads, and pluggable session storage.
    • Authorization — Policy[T], RequirePolicy(...), built-in chat-type and admin checks, and AllPolicies / AnyPolicy / NotPolicy combinators.
    • Observability — typed Observer events covering update receipt, handler start/finish, scene transitions, policy checks, runner completion, polling retries, and centralized errors (including panics).
    • tgfmt — new package with typed MarkdownV2, HTML, and legacy Markdown formatting helpers.
    • Compact payload encoding — BotPayloadCompact / BotPayloadCompactBase64 for shorter callback data.
    • RateLimiter.Cleanup — evict idle per-chat state to bound memory in long-running bots.

    Breaking changes

    This release consolidates all RC-era API renames into a stable surface. If you are upgrading from an RC, see the Migration guide.

    The most impactful changes:

    What changed Before After
    Context type MsgContext MessageContext
    Plugin builder NewCommand(...), NewScene(...) Command(...), Scene(...)
    Runner builders Onetime(bool), Timeout(d) Async(bool), Every(d)
    Observer methods OnReceiveUpdate, OnHandledUpdate OnUpdateReceived, OnUpdateHandled
    Payload sentinels var BotPayloadType* const BotPayloadType*
    Scene ownership Scene.PluginName (public field) unexported, set by framework
    Session data SceneSession.Data []byte unexported, use accessor helpers
    Error visibility unclassified errors → user reply unclassified errors → internal only; use AsUserError(...) to surface
    Webhook API names RunWebHookWithContext, CloseWebHook RunWebhookWithContext, CloseWebhook

    Notable fixes

    • Webhook secret comparison now uses subtle.ConstantTimeCompare (timing side-channel removed).
    • /status endpoint returns HTTP 404 (not 403) for wrong secret to hide endpoint existence.
    • tgapi.Uploader now returns *tgapi.ResponseError on Telegram API failures, consistent with the JSON API client.
    • Worker pool now waits for in-flight handlers before runtime exit (StopAndWait).
    • RateLimiter lock upgrade could deadlock under contention — fixed.
    • Panics in Bot.handle and the polling goroutine now emit ErrorEvent through the observer.
    • BotOptsFileJSON was silently dropping PollTimeout on round-trip — fixed.

    Links

    What's Changed

    Full Changelog: v0.7.1...v1.0.0

    Downloads
  • 1.0.0 RC 16
    Golang lint / lint (push) Successful in 2m15s
    Pre-Release

    ScuroNeko released this 2026-04-29 12:31:41 +03:00 | 36 commits to dev since this release

    Breaking Changes

    • Replaced git.scuroneko.dev/scuroneko/slog with git.scuroneko.dev/scuroneko/sneklog/v2 across public logger APIs, including AppDataLogger, logger getters, and custom logger setters.
    • Renamed exported Json, Url, and Id identifiers to idiomatic JSON, URL, and ID spellings, including BotOpts.APIURL, BotOpts.SetAPIURL(...), tgapi.APIOpts.SetAPIURL(...), BotOptsFileJSONCodec, BotPayloadJSON, and related README examples.
    • Made the request logger field internal; use Bot.SetRequestLogger(...) and Bot.GetRequestLogger() instead of accessing Bot.RequestLogger directly.

    Added

    • Added Bot.UpdatesIter(...) as an iterator wrapper around a single Bot.Updates(...) call, including error delivery through the iterator.
    • Added scene-local callback payload handlers through Scene.OnPayload(...), including observer lifecycle events for scene payload execution.
    • Added configurable logger output through BotOpts.LogFormat, BotOpts.SetLogFormat(...), BotOpts.SetLogFormatter(...), tgapi.APIOpts.SetLogFormat(...), and tgapi.APIOpts.SetLogFormatter(...).
    • Added JSON BotOpts file format versioning through ConfigVersion, ErrConfigVersionMismatch, and BotOpts.FileConfigVersion.
    • Added Bot.SetLogger(...), Bot.SetRequestLogger(...), Bot.SetWebHookLogger(...), Bot.GetRequestLogger(), and Bot.GetWebHookLogger() helpers for explicit logger customization.

    Changed

    • Updated pond/v2 to v2.7.1.
    • Bot.RunWithContext(...) now closes an explicitly set request logger when UseRequestLogger is false and closes webhook loggers before long-polling startup.
    • Bot loggers now apply the configured token replacer consistently across the main bot logger, request logger, internal API and uploader loggers, webhook logger, app-data logger writers, and auto-managed plugin loggers.
    • JSON BotOpts files now write version, reject newer unsupported config versions, keep older unversioned files loadable, and preserve the loaded file version in BotOpts.FileConfigVersion.
    • Bot.RunWithContext(...) treats context.DeadlineExceeded like context.Canceled and exits polling without retry logging.
    • README and README_RU now use the current JSON, URL, and ID public API names.

    Fixed

    • Fixed the go-lint workflow file to end with a newline.

    Tests

    • Added regression coverage for Bot.UpdatesIter(...) error delivery and early iterator stop behavior.
    • Added regression coverage proving Bot.RunWithContext(...) preserves polling retry attempts and backoff delays across repeated getUpdates failures.
    • Added regression coverage proving polling startup preserves an enabled request logger.
    • Updated file logger regression coverage for the current sneklog text prefix format.
    • Added regression coverage proving token masking still applies after initLoggers(...) switches loggers to file-backed writers and that auto-managed plugin loggers inherit token masking.
    • Added regression coverage for JSON config version handling and scene-local payload routing, including observer lifecycle events and callback fallthrough behavior.
    • Updated logger helper tests for the explicit log format and formatter parameters.

    Full Changelog: v1.0.0-rc.15...v1.0.0-rc.16

    Downloads
  • 1.0.0 RC 15
    Golang lint / lint (push) Successful in 2m34s
    Pre-Release

    ScuroNeko released this 2026-04-23 22:24:11 +03:00 | 42 commits to dev since this release

    Changed

    • Added file-based BotOpts loading and saving through LoadBotOptsFile(...), SaveBotOptsFile(...), and the BotOptsFileCodec API, with built-in JSON support.
    • Added plugin-level message fallback handlers for text messages and channel posts that do not match commands.
    • Added godoc for the exported BotOpts file codec and load/save helpers.
    • README, README_RU, and bot-configuration wiki pages now document file-based BotOpts loading, built-in JSON support, env placeholder expansion, and custom codec usage including the TOML example.
    • Active scenes now let unmatched slash-commands continue into normal bot command routing instead of also executing the current scene step or scene message fallback.

    Tests

    • Added regression coverage for JSON BotOpts file codecs, file load/save helpers, decode failures, and env placeholder expansion.
    • Added regression coverage for plugin message fallback routing, observer lifecycle events, command precedence, and middleware blocking.
    • Added regression coverage proving unmatched slash-commands do not trigger active scene step handlers before normal bot command routing.

    Full Changelog: v1.0.0-rc.14...v1.0.0-rc.15

    Downloads