(fix): webhook secret constant-time compare
Golang lint / lint (pull_request) Successful in 2m53s
Golang lint / lint (push) Successful in 2m55s

(fix): observer rename, panic emits ErrorEvent
(refactor): Runner.Once removed, Scene.PluginName unexported
(doc): godoc hygiene pre-1.0.0
This commit is contained in:
2026-05-20 12:06:59 +03:00
parent 1e26d871b5
commit 61d0b1ebb8
29 changed files with 191 additions and 138 deletions
+4 -3
View File
@@ -25,15 +25,16 @@ func (bot *Bot[T]) handleMessage(update *tgapi.Update, ctx *MessageContext) bool
cmd = cmd[:len(cmd)-len("@"+botUsername)] // remove @botname
}
}
// Ищем команду по точному совпадению
for _, plugin := range bot.plugins {
if _, exists := plugin.commands[cmd]; exists {
ctx.Text = args
ctx.Args = strings.Fields(args)
ctx.Logger = plugin.logger
if plugin.logger != nil {
ctx.Logger = plugin.logger
if ctx.Logger == nil {
ctx.Logger = bot.logger
}
if !plugin.executeMiddlewares(ctx, bot.appData) {
return false