diff --git a/bot.go b/bot.go index ea93a16..b54db31 100644 --- a/bot.go +++ b/bot.go @@ -200,7 +200,14 @@ func (bot *Bot) Run() error { u := &Update{ Update: &up, } - chn, ok := handles[u.FromChat().Type] + + // Sometimes returns nil. + fromChat := u.FromChat() + if fromChat == nil { + continue + } + + chn, ok := handles[fromChat.Type] if !ok { continue }