fix: correct Telegram update/keyboard models and harden env parsing

This commit is contained in:
2026-03-17 16:17:26 +03:00
parent 1e043da05d
commit 4ebe76dd4a
26 changed files with 992 additions and 140 deletions

14
handler_test.go Normal file
View File

@@ -0,0 +1,14 @@
package laniakea
import "testing"
func TestCheckPrefixesSkipsEmptyPrefixes(t *testing.T) {
bot := &Bot[NoDB]{prefixes: []string{"", "/"}}
if prefix, ok := bot.checkPrefixes("hello"); ok {
t.Fatalf("unexpected prefix match for plain text: %q", prefix)
}
if prefix, ok := bot.checkPrefixes("/start"); !ok || prefix != "/" {
t.Fatalf("unexpected prefix result: prefix=%q ok=%v", prefix, ok)
}
}