refactor(logging): use context logger in MsgContext

This commit is contained in:
2026-03-24 14:02:51 +03:00
parent 7776acaf12
commit 401173714e
4 changed files with 24 additions and 26 deletions
+2 -3
View File
@@ -22,7 +22,6 @@ func (bot *Bot[T]) handle(u *tgapi.Update) {
ctx := &MsgContext{
Update: *u, Api: bot.api,
botLogger: bot.logger,
errorTemplate: bot.errorTemplate,
l10n: bot.l10n,
draftProvider: bot.draftProvider,
@@ -100,7 +99,7 @@ func (bot *Bot[T]) handleMessage(update *tgapi.Update, ctx *MsgContext) {
ctx.Logger = plugin.logger
if ctx.Logger == nil {
ctx.Logger = ctx.botLogger
ctx.Logger = bot.logger
}
plugin.executeCmd(cmd, ctx, bot.dbContext)
return
@@ -138,7 +137,7 @@ func (bot *Bot[T]) handleCallback(update *tgapi.Update, ctx *MsgContext) {
}
ctx.Logger = plugin.logger
if ctx.Logger == nil {
ctx.Logger = ctx.botLogger
ctx.Logger = bot.logger
}
plugin.executePayload(data.Command, ctx, bot.dbContext)
return