diff --git a/handler.go b/handler.go index dd9bcd0..99a6759 100644 --- a/handler.go +++ b/handler.go @@ -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 == "" { - bot.logger.Warnln("empty prefix is not allowed") + if bot.logger != nil { + bot.logger.Warnln("empty prefix is not allowed") + } continue } if strings.HasPrefix(text, prefix) {