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

9
td.go
View File

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