diff --git a/main.go b/main.go index 2a15296..cd7277e 100644 --- a/main.go +++ b/main.go @@ -103,7 +103,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64) { bkp := DataBackup{} s := new([]ChatWarsMessage) - msgs := *s + bkpmsgs := *s for lastParsedID64 >= 0 { prevLastParsedID64 := lastParsedID64 @@ -151,7 +151,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64) { } if m.ID64 != 0 { - msgs = append(msgs, m) + bkpmsgs = append(bkpmsgs, m) msgCount = msgCount + 1 } default: @@ -186,7 +186,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64) { log.Printf("Exported %d messages.\n", msgCount) fmt.Printf("Exported %d messages.\n", msgCount) - bkp.Messages = msgs + bkp.Messages = bkpmsgs b, err := json.Marshal(bkp) logOnError(err, "getHistory : Marshal")