From 2063c42b78c0ff861a83241ae3d09499541511f2 Mon Sep 17 00:00:00 2001 From: shoopea Date: Sun, 29 Dec 2019 11:14:36 +0800 Subject: [PATCH] test --- main.go | 2 +- td.go | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index e23c561..863e4ec 100644 --- a/main.go +++ b/main.go @@ -65,6 +65,6 @@ func main() { ownUserID32 = OwnUserID(client) ownUserID64 = int64(OwnUserID(client)) - getHistory(client, chtwrsID64) + getHistory(client, &chtwrsID64) } diff --git a/td.go b/td.go index 530d0f8..fb4c309 100644 --- a/td.go +++ b/td.go @@ -10,19 +10,22 @@ import ( "github.com/Arman92/go-tdlib" ) -func getHistory(c *tdlib.Client, chatID64 int64) { +func getHistory(c *tdlib.Client, chatID64 *int64) { var msgCount int32 = 0 var msgParsed int32 = 0 var loopOverflow int32 = 0 var lastParsedID64 int64 = int64(math.MaxInt64) var lastParsedTime time.Time = time.Now() var m ChatWarsMessage + var chat int64 - fmt.Printf("Getting details for chatID64 %d ...\n", chatID64) + chat = *chatID64 + + fmt.Printf("Getting details for chatID64 %d ...\n", chat) chatDetails, err := c.GetChat(chatID64) failOnError(err, "getHistory : GetChat") - fmt.Printf("Exporting historic messages for chat %d (%s) ...\n", chatID64, chatDetails.Title) + fmt.Printf("Exporting historic messages for chat %d (%s) ...\n", chat, chatDetails.Title) for lastParsedID64 >= 0 { prevLastParsedID64 := lastParsedID64