diff --git a/td.go b/td.go index 1cb8714..e98b8d9 100644 --- a/td.go +++ b/td.go @@ -101,8 +101,8 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) { msgs, err := c.GetChatHistory(chat, lastParsedID64, 0, 33, false) if err != nil { if err.Error() == "timeout" { - logOnError(err, "Waiting...") - fmt.Printf("Timeout : %d messages retrieved out of %d dating back %s (%d) ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339), lastParsedID64) + logOnError(err, "Waiting....") + fmt.Printf("Timeout : %d messages retrieved out of %d dating back %s (%d) ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339), lastParsedID64) time.Sleep(5 * time.Second) } else { logOnError(err, "Cannot get history") @@ -153,7 +153,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) { lastParsedTime = m.Date } if msgParsed%1000 == 0 { - fmt.Printf("Waiting : %d messages retrieved out of %d dating back %s (%d) ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339), lastParsedID64) + fmt.Printf("Waiting : %d messages retrieved out of %d dating back %s (%d) ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339), lastParsedID64) } } @@ -166,6 +166,8 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) { // we should be at the end ! lastParsedID64 = -1 } else { + logOnError(err, "Overflow ...") + fmt.Printf("Overflow : %d messages retrieved out of %d dating back %s (%d) ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339), lastParsedID64) time.Sleep(5 * time.Second) } }