Releases
-
released this
2026-10-08 10:49:29 +03:00 | 3 commits to dev since this releasev2.0.0-rc.3 (2026-10-08)
Added
- Added
MultiObserverandNewMultiObserverto 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.RawandRichBlockUnknown.Rawfromjson.RawMessagetojsontext.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_updateslists 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
omitemptyandomitzerohandling 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
- Added
-
v2.0.0 RC 2
Pre-ReleaseGolang lint / lint (push) Failing after 2m42sreleased this
2026-09-24 11:39:31 +03:00 | 1 commits to main since this releasev2.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.2and 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
Pre-ReleaseGolang lint / lint (push) Failing after 1m37sreleased this
2026-09-08 23:21:38 +03:00 | 6 commits to dev since this releasev2.0.0-rc.1 (2026-09-08)
Added
- Added Bot API 10.3 rich buttons:
RichMessageButton,RichTextButton,RichBlockButtons, andInputRichBlockButtons, including inline-query chat selection, login, clipboard, and disabled actions. Empty inline queries are preserved through pointer fields;RichMessageButtonStyleLinksupports borderless callback buttons. - Added incoming and outgoing expandable block quotations and document blocks, with
tgrich.Button,Buttons,ButtonsWithAlign,ExpandableBlockquote,ExpandableBlockquoteWithCredit,Document, andDocumentWithCaptionhelpers. - Added compact rich tables through
IsCompactandRichTable.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
ErrRichInvalidButtonfromtgrichbuilders. - Added HTML rendering for rich buttons, expandable quotations, and documents. Document media is collected into
InputRichMessage.Mediawithtg://document?id=references and supports multipart attachments through the existing rich-message uploader. - Added
EphemeralMessageParameters, includingReplaceCallbackQueryMessage, 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 throughUploader.EditEphemeralMessageMedia. - Added
RichMessagetoEditEphemeralMessageTextandShowCaptionAboveMediatoEditEphemeralMessageCaption. - Added
CanStopandKeepOnStopto message and rich-message draft parameters. Stopped-generation updates are decoded asUpdateTypeMessageGenerationStoppedand expose their chat through normalized message context. - Added disabled inline buttons and
SetDisabled, plusForceReplysupport on specialized inline and reply keyboard markup. - Added
CommunityChatJoinedservice messages;UniqueGiftInfo.Text,Entities, andIsPrivate; andCanSendWelcomeMessagesto administrator members, rights, and promotion parameters. - Added
RichTextUnknownandRichBlockUnknownto preserve unrecognized Telegram rich objects without losing fields. - Added explicit
InlineKeyboard.SetUnlimitedRowsconfiguration.
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.UserandVoterChatare now pointers; removedVoterUserandVoterChatInfo. Update-context normalization and tests use the pointer fields.RunnerFnandNewRunnernow require callbacks withcontext.Context; removedContextRunnerFnandNewContextRunner.InlineKeyboard.Getnow validates and returns(*tgapi.ReplyMarkup, error); removedGetValidatedand keyboard-levelValidate. Message-context helpers reject invalid keyboards before sending or editing. Previously built rows exceeding a subsequently lowered row limit now fail final validation.CallbackData.Encodenow returns(string, error)and validates encoding and payload length; removedEncodeValidated.- Moved custom request execution from
TelegramRequest.Do/DoWithContexttoAPI.Do/DoWithContext, and fromUploaderRequestmethods to the correspondingUploadermethods. - Renamed
ChatFullInfo.AvailableReactiontoAvailableReactions,ReplyParameters.QuoteParsingModetoQuoteParseMode, andInputChecklist.OtherCanAddTasks/OtherCanMarkTasksAsDonetoOthersCanAddTasks/OthersCanMarkTasksAsDone; JSON keys remain unchanged. - Removed
DeleteAllMessageReactionWithContext; useDeleteAllMessageReactionsWithContext. - The JSON and multipart send parameter structs listed above replace top-level
ReceiverUserIDandCallbackQueryIDwithEphemeralMessageParameters. UnmarshalRichMessagenow requires a non-nullblocksarray. Unknown rich objects use lossless raw wrappers instead of lossy text wrappers or errors.- Removed the unbounded
API.GetFileByLinkandGetFileByLinkWithContext; useGetFileByLinkLimit*with an explicit byte limit orOpenFileByLink*for streaming. - Non-positive inline-keyboard row limits are invalid by default; call
SetUnlimitedRowsto 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
- Added Bot API 10.3 rich buttons:
-
1.2.0
Stablereleased this
2026-08-20 11:08:45 +03:00 | 4 commits to main since this releasev1.2.0
Added
- Added cancelable background runners through
ContextRunnerFnandNewContextRunner; existingRunnerFnandNewRunnerremain available for compatibility. - Added validated inline-keyboard APIs:
InlineKeyboardButtonBuilder.Validate/Build,InlineKeyboard.Validate/GetValidated, andCallbackData.EncodeValidated, with typed errors for invalid actions, callback-data length, and oversized rows. - Added bounded file-download helpers
GetFileByLinkLimitandGetFileByLinkLimitWithContextwithErrFileTooLarge; existing unbounded and streaming helpers remain available. - Added strict root rich-message parsing through
UnmarshalRichMessageStrictand structural rich JSON depth/node limits withErrRichJSONDepthandErrRichJSONNodes. - Added
APIOpts.SetMaxRetriesfor Telegram 429 responses. Automatic JSON and multipart retries now default to at most three attempts after the initial request and returnErrRetryLimitwhen exhausted. - Added
SetChatPhotoWithContextand the correctly pluralizedDeleteAllMessageReactionsWithContext; the old singular compatibility alias remains deprecated until v2. - Added
PollAnswer.VoterUserandPollAnswer.VoterChatInfopresence 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
CommandScopeUpdateErrorand 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, andAnswerMessage.EditRichKeyboard, plusAnswerMessage.RichHTMLfor rendered rich content. - Added
NewBotWithAPIfor 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
AsUserErrorvalues 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.BindArgsaccepting 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
SceneActionvalues 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_aftervalues 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, andquote_parse_mode. - Fixed
MessageContexttext, 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
RichTextArrayvalues bypassing rich-message depth validation and renderer limits. - Fixed polling panics being reported only through telemetry while
RunWithContextreturned 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/v2IDs. - Marked v1 compatibility surfaces that may change in v2:
PollAnswervoter 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-lintv2.12.2for 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
- Added cancelable background runners through
-
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
-
released this
2026-07-08 12:02:38 +03:00 | 12 commits to dev since this releasev1.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.Errorwrapscontext.DeadlineExceeded), causing the goroutine to exit as if the bot context was canceled. The check is nowctx.Err() != nilso only a real context cancellation stops polling. - Fixed the HTTP client timeout (45 s) being too close to the long-poll
getUpdatestimeout (30 s default), leaving insufficient margin for connection setup and response transfer. The client timeout is now derived from the configuredPollTimeoutplus a 60-second buffer.
What's Changed
Full Changelog: v1.0.1...v1.0.2
Downloads
- Fixed long-polling stopping permanently when the HTTP client's internal timeout fired. The polling loop was checking
-
1.0.1
Stablereleased this
2026-06-11 13:34:48 +03:00 | 13 commits to dev since this releaseFixed
- Fixed webhook always accepting unauthenticated requests when
SecretTokenis not configured. A cryptographically random 32-byte token is now generated automatically whenSecretTokenis empty, so the webhook endpoint is always authenticated. The generated token is logged as a warning so the operator can record it. - Fixed
tgapi.NewAPIandtgapi.NewUploadernot installing token redaction on their managed loggers. The bot token is now masked as<TOKEN>in debug output even when thetgapipackage is used standalone without thelaniakea.Botwrapper.
What's Changed
Contributors
New Contributors
- @ScuroNeko made their first contribution in #3
Full Changelog: v1.0.0...v1.0.1
Downloads
- Fixed webhook always accepting unauthenticated requests when
-
1.0.0
Stablereleased this
2026-05-20 13:23:31 +03:00 | 18 commits to main since this releaseLaniakea 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, andAllPolicies/AnyPolicy/NotPolicycombinators. - Observability — typed
Observerevents 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/BotPayloadCompactBase64for 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 MsgContextMessageContextPlugin builder NewCommand(...),NewScene(...)Command(...),Scene(...)Runner builders Onetime(bool),Timeout(d)Async(bool),Every(d)Observer methods OnReceiveUpdate,OnHandledUpdateOnUpdateReceived,OnUpdateHandledPayload sentinels var BotPayloadType*const BotPayloadType*Scene ownership Scene.PluginName(public field)unexported, set by framework Session data SceneSession.Data []byteunexported, use accessor helpers Error visibility unclassified errors → user reply unclassified errors → internal only; use AsUserError(...)to surfaceWebhook API names RunWebHookWithContext,CloseWebHookRunWebhookWithContext,CloseWebhookNotable fixes
- Webhook secret comparison now uses
subtle.ConstantTimeCompare(timing side-channel removed). /statusendpoint returns HTTP 404 (not 403) for wrong secret to hide endpoint existence.tgapi.Uploadernow returns*tgapi.ResponseErroron Telegram API failures, consistent with the JSON API client.- Worker pool now waits for in-flight handlers before runtime exit (
StopAndWait). RateLimiterlock upgrade could deadlock under contention — fixed.- Panics in
Bot.handleand the polling goroutine now emitErrorEventthrough the observer. BotOptsFileJSONwas silently droppingPollTimeouton round-trip — fixed.
Links
What's Changed
Full Changelog: v0.7.1...v1.0.0
Downloads
-
1.0.0 RC 16
Pre-ReleaseGolang lint / lint (push) Successful in 2m15sreleased this
2026-04-29 12:31:41 +03:00 | 36 commits to dev since this releaseBreaking Changes
- Replaced
git.scuroneko.dev/scuroneko/slogwithgit.scuroneko.dev/scuroneko/sneklog/v2across public logger APIs, includingAppDataLogger, logger getters, and custom logger setters. - Renamed exported
Json,Url, andIdidentifiers to idiomaticJSON,URL, andIDspellings, includingBotOpts.APIURL,BotOpts.SetAPIURL(...),tgapi.APIOpts.SetAPIURL(...),BotOptsFileJSONCodec,BotPayloadJSON, and related README examples. - Made the request logger field internal; use
Bot.SetRequestLogger(...)andBot.GetRequestLogger()instead of accessingBot.RequestLoggerdirectly.
Added
- Added
Bot.UpdatesIter(...)as an iterator wrapper around a singleBot.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(...), andtgapi.APIOpts.SetLogFormatter(...). - Added JSON BotOpts file format versioning through
ConfigVersion,ErrConfigVersionMismatch, andBotOpts.FileConfigVersion. - Added
Bot.SetLogger(...),Bot.SetRequestLogger(...),Bot.SetWebHookLogger(...),Bot.GetRequestLogger(), andBot.GetWebHookLogger()helpers for explicit logger customization.
Changed
- Updated
pond/v2tov2.7.1. Bot.RunWithContext(...)now closes an explicitly set request logger whenUseRequestLoggeris 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
BotOptsfiles now writeversion, reject newer unsupported config versions, keep older unversioned files loadable, and preserve the loaded file version inBotOpts.FileConfigVersion. Bot.RunWithContext(...)treatscontext.DeadlineExceededlikecontext.Canceledand exits polling without retry logging.- README and README_RU now use the current
JSON,URL, andIDpublic 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
sneklogtext 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
- Replaced
-
1.0.0 RC 15
Pre-ReleaseGolang lint / lint (push) Successful in 2m34sreleased this
2026-04-23 22:24:11 +03:00 | 42 commits to dev since this releaseChanged
- Added file-based
BotOptsloading and saving throughLoadBotOptsFile(...),SaveBotOptsFile(...), and theBotOptsFileCodecAPI, 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
BotOptsfile codec and load/save helpers. - README, README_RU, and bot-configuration wiki pages now document file-based
BotOptsloading, 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
BotOptsfile 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
- Added file-based