From 29bce7bb7bc4f5909f53dfc0965202acdc756327 Mon Sep 17 00:00:00 2001 From: shoopea Date: Fri, 3 May 2019 19:10:03 +0800 Subject: [PATCH] time --- td.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/td.go b/td.go index 7c0f721..8b26342 100644 --- a/td.go +++ b/td.go @@ -110,6 +110,7 @@ func ListenCW(c *tdlib.Client) { func getHistory(c *tdlib.Client) { var lastMsgID64 int64 = int64(math.MaxInt64) var msgCount int32 = 0 + var lastMsgTime Time = time.Now() fmt.Printf("Retrieving chat.\n") @@ -142,7 +143,7 @@ func getHistory(c *tdlib.Client) { if err != nil { if err.Error() == "timeout" { logOnError(err, "Waiting...") - fmt.Printf("Waiting (%d messages retrieved).\n", msgCount) + fmt.Printf("Waiting : %d messages retrieved from %s ...\n", msgCount, lastMsgTime.Format(time.RFC3339)) } else { logOnError(err, "Cannot get history") lastMsgID64 = -1 @@ -176,6 +177,7 @@ func getHistory(c *tdlib.Client) { }) if msg.ID < lastMsgID64 { lastMsgID64 = msg.ID + lastMsgTime = time.Unix(m.Date, 0) } msgCount = msgCount + 1 default: