fix: guard nil logger in prefix check

This commit is contained in:
2026-03-27 16:06:24 +03:00
parent 4f8d583b03
commit 3ad9e48d71
+2
View File
@@ -270,7 +270,9 @@ func (bot *Bot[T]) prepareUpdateCtx(u *tgapi.Update, ctx *MsgContext) {
func (bot *Bot[T]) checkPrefixes(text string) (string, bool) {
for _, prefix := range bot.prefixes {
if prefix == "" {
if bot.logger != nil {
bot.logger.Warnln("empty prefix is not allowed")
}
continue
}
if strings.HasPrefix(text, prefix) {