This commit is contained in:
shoopea 2019-05-09 18:38:17 +08:00
parent a7281f189b
commit 1421010036

3
td.go
View File

@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"log" "log"
"math" "math"
"strconv"
"time" "time"
"github.com/Arman92/go-tdlib" "github.com/Arman92/go-tdlib"
@ -151,7 +152,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) {
} }
if m.ID64 < lastParsedID64 { if m.ID64 < lastParsedID64 {
lastParsedID64 = msg.ID lastParsedID64 = msg.ID
lastParsedTime = time.Unix(int64(m.Date), 0) lastParsedTime = m.Date
} }
if msgParsed%1000 == 0 { 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)