This commit is contained in:
shoopea 2019-12-29 11:08:57 +08:00
parent 9300ca721a
commit c86d795e79

6
td.go
View File

@ -19,13 +19,15 @@ func getHistory(c *tdlib.Client, chatID64 int64) {
var chat int64
var m ChatWarsMessage
fmt.Printf("Getting details for chatID64 %d ...\n", chatID64)
chatDetails, err := c.GetChat(chatID64)
failOnError(err, "getHistory : GetChat")
fmt.Printf("Exporting historic messages for chat %d (%s) ...\n", chat, chatDetails.Title)
fmt.Printf("Exporting historic messages for chat %d (%s) ...\n", chatID64, chatDetails.Title)
for lastParsedID64 >= 0 {
prevLastParsedID64 := lastParsedID64
msgs, err := c.GetChatHistory(chat, lastParsedID64, 0, 99, false)
msgs, err := c.GetChatHistory(chatID64, lastParsedID64, 0, 99, false)
if err != nil {
if err.Error() == "timeout" {
logOnError(err, "Waiting....")