liamcottle / valorant.js

This is an unofficial NodeJS library for interacting with the VALORANT API used in game.
105 stars 19 forks source link

getPlayerMMR not correctly returning LatestCompetitiveUpdate #11

Closed Lunium closed 3 years ago

Lunium commented 3 years ago

When you use the getPlayerMMR call to get the MMR data of a player, and that player hasn't played a Competitive game as his last played game. Then the LatestCompetitiveUpdate will not have that player's latest competitive update.

Expected behavior would be that the LatestCompetitiveUpdate would always be filled with the latest competitive update.

For instance: If a player has played a Deathmatch game as his latest game, this method will be useless as it shows the info of the Deathmatch game. Which means that there is no MMR data for that player.

liamcottle commented 3 years ago

Unfortunately that's how that specific VALORANT API was coded by Riot.

This isn't an issue with this library, that's just the data returned directly from the API.

An alternative would be to use one of the other endpoints which returns a list of historical matches, in which case you could then iterate over them and check the match game mode is the one you want.