refactor logging setup and split local/remote close APIs

This commit is contained in:
2026-03-24 13:45:19 +03:00
parent db31246eeb
commit 7776acaf12
18 changed files with 283 additions and 66 deletions
+9
View File
@@ -97,6 +97,11 @@ func (bot *Bot[T]) handleMessage(update *tgapi.Update, ctx *MsgContext) {
if !plugin.executeMiddlewares(ctx, bot.dbContext) {
return
}
ctx.Logger = plugin.logger
if ctx.Logger == nil {
ctx.Logger = ctx.botLogger
}
plugin.executeCmd(cmd, ctx, bot.dbContext)
return
}
@@ -131,6 +136,10 @@ func (bot *Bot[T]) handleCallback(update *tgapi.Update, ctx *MsgContext) {
if !plugin.executeMiddlewares(ctx, bot.dbContext) {
return
}
ctx.Logger = plugin.logger
if ctx.Logger == nil {
ctx.Logger = ctx.botLogger
}
plugin.executePayload(data.Command, ctx, bot.dbContext)
return
}