Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,19 @@ type Account struct {
FractalLevel int `json:"fractal_level"`
DailyAP int `json:"daily_ap"`
MonthlyAP int `json:"monthly_ap"`
WvWRank int `json:"wvw_rank"`
// Deprecated: Use WvW.Rank instead
WvWRank int `json:"wvw_rank"`
LastModified time.Time `json:"last_modified"`
WvW AccountWvWInfo `json:"wvw"`
}

// Account returns general account information
func (s *Session) Account() (account Account, err error) {
err = s.getWithAuth("/v2/account", &account)
err = s.getWithAuth("/v2/account?v=2024-07-20T01:00:00.000Z", &account)
// Backwards compatibility for Account.WvWRank, as that information is now in Account.WvW.Rank
if account.WvW.Rank > 0 {
account.WvWRank = account.WvW.Rank
}
return
}

Expand Down Expand Up @@ -291,3 +298,9 @@ func (s *Session) AccountLegendaryArmory() (res []*AccountLegendaryArmoryItem, e
err = s.getWithAuth("/v2/account/legendaryarmory", &res)
return
}

// AccountWvWInfo is the accounts WvW information
type AccountWvWInfo struct {
TeamID int `json:"team_id"`
Rank int `json:"rank"`
}
Loading