REPOSITORY / ScuroNeko/Laniakea
Releases
-
1.0.0 RC 7 Pre-Release
released this
2026-03-24 13:45:19 +03:00 | 63 commits to dev since this releaseRelease Notes
- Extracted shared logger construction into package-level helpers:
utils.CreateLogger(prefix, level)andutils.CreateFileLogger(prefix, level, filePath). - Unified logger initialization across
Bot,tgapi.API, andtgapi.Uploader. - Added
MsgContext.Logger, populated from the matched plugin and falling back to the bot logger when no plugin logger is configured. - Added plugin lifecycle/configuration methods:
SetLogger,RemoveLogger,SetOnClose, andClose. Bot.Close()now performs local resource teardown only and also invokesPlugin.Close()for registered plugins.- Added
Bot.CloseRemote(ctx)for Telegram Bot APIclose, separating remote close from local cleanup. - Renamed local
tgapi.APIshutdown toClose(). - Renamed Telegram Bot API
closewrappers intgapi.APItoCloseRemote()andCloseRemoteWithContext(). Bot.Debug()now updates log levels for the bot logger, request logger, and already registered plugin loggers.Bot.AddPlugins()now creates a default plugin logger automatically when one is not provided.Bot.AddDatabaseLoggerWriter()now also attaches the writer to already registered plugin loggers.- Updated tests for the new shutdown and logging behavior.
- Expanded godoc for the new APIs and documented plugin registration as a configuration commit point.
Breaking Changes
(*Bot).Close(ctx context.Context)was replaced with(*Bot).Close().(*Bot).CloseRemote(ctx context.Context)was added as the explicit wrapper for Telegram Bot APIclose.(*tgapi.API).CloseApi()was renamed to(*tgapi.API).Close().(*tgapi.API).Close()was renamed to(*tgapi.API).CloseRemote().(*tgapi.API).CloseWithContext()was renamed to(*tgapi.API).CloseRemoteWithContext().
Migration Guide
- Replace
bot.Close(ctx)withbot.Close(). - If you need Telegram Bot API
close, usebot.CloseRemote(ctx). - Replace
api.CloseApi()withapi.Close(). - Replace
api.Close()withapi.CloseRemote(). - Replace
api.CloseWithContext(ctx)withapi.CloseRemoteWithContext(ctx). - If you configure plugin loggers or
OnClose, do so before callingbot.AddPlugins(...).
Notes
- Registering a plugin via
AddPluginsis a configuration commit point; the plugin should not be mutated through the original*Pluginafterward. - If plugin loggers must receive a database writer, call
AddDatabaseLoggerWriter(...)after registering plugins.
Full Changelog: v1.0.0-rc.5...v1.0.0-rc.7
Downloads
- Extracted shared logger construction into package-level helpers: