This commit is contained in:
shoopea 2019-05-03 18:56:13 +08:00
parent 6a4cf19a0f
commit c20116fa44

5
td.go
View File

@ -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 {
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() {