benweier / blizzard.js

A promise-based Node.JS library for the Blizzard Battle.net Community Platform API
MIT License
145 stars 29 forks source link

PvP Leaderboards missing #177

Open oliv-tree opened 7 months ago

oliv-tree commented 7 months ago

Hey,

Both /data/wow/pvp-season/{pvpSeasonId}/pvp-leaderboard/index and /data/wow/pvp-season/{pvpSeasonId}/pvp-leaderboard/{pvpBracket} seem to be missing

benweier commented 7 months ago

Hey @oliv-tree, the PVP Season API is currently available on the retail client but not on the classic client. Checking the documentation it does look like it is supported by the classic game data APIs now so I may need to add this to the lib

oliv-tree commented 7 months ago

Hey @oliv-tree, the PVP Season API is currently available on the retail client but not on the classic client. Checking the documentation it does look like it is supported by the classic game data APIs now so I may need to add this to the lib

Again this was my bad, however I think the implementation is quite confusing. I.e., how you would reach the code for each of these is not very clear from the docs/types.

let leaderboardIndex = await wowClient.pvpSeason({
  id: 36,
  resource: "leaderboard",
})
let leaderboard = await wowClient.pvpSeason({
  id: 36,
  bracket: "shuffle-demonhunter-havoc",
  resource: "leaderboard",
})
let season = await wowClient.pvpSeason({
  id: 36,
})
let seasonRewards = await wowClient.pvpSeason({
  id: 36,
  resource: "reward",
})
benweier commented 7 months ago

I agree it's not as clear as it could be and there's an opportunity here to improve the documentation