diff --git a/td.go b/td.go index 3ea7155..0bbfc24 100644 --- a/td.go +++ b/td.go @@ -138,8 +138,13 @@ func getHistory(c *tdlib.Client) { for lastMsgID64 >= 0 { msgs, err := c.GetChatHistory(user_chtwrsbot, lastMsgID64, 0, 50, false) if err != nil { - logOnError(err, "Cannot get history") - lastMsgID64 = -1 + if err.Error() == "timeout" { + logOnError(err, "Waiting...") + fmt.Printf("Waiting (%d messages retrieved).\n", msgCount) + } else { + logOnError(err, "Cannot get history") + lastMsgID64 = -1 + } } else { for _, msg := range msgs.Messages { switch msg.Content.GetMessageContentEnum() {