From c20116fa44c733fd25afe36913b2e825a1d52fbc Mon Sep 17 00:00:00 2001 From: shoopea Date: Fri, 3 May 2019 18:56:13 +0800 Subject: [PATCH] test --- td.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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() {