This commit is contained in:
shoopea 2019-12-29 11:14:36 +08:00
parent 56ce43a593
commit 2063c42b78
2 changed files with 7 additions and 4 deletions

View File

@ -65,6 +65,6 @@ func main() {
ownUserID32 = OwnUserID(client)
ownUserID64 = int64(OwnUserID(client))
getHistory(client, chtwrsID64)
getHistory(client, &chtwrsID64)
}

9
td.go
View File

@ -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