diff --git a/README.md b/README.md index 2ab61a1..0acd87d 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ `valorant.py` is an unofficial API wrapper for Riot Games' Valorant API endpoints. It's modern, easy to use, feature-rich, and intuitive! +**[\*\*]** *Just a little note, the developement of this project will slow down a bit as I enter into college and other life stuff, but rest assured I don't plan on abandoning this. Thanks for understanding!* + ## Features + **Simple:** High-level abstraction of API interactions; easy to use and easy to customize. @@ -70,4 +72,4 @@ Have a bug or issue? Need help with the API? Open an [issue](https://github.com/ ## Contributing -Head over to the [**Contributing Guide**](https://github.com/frissyn/valorant.py/blob/master/.github/CONTRIBUTING.md) page. \ No newline at end of file +Head over to the [**Contributing Guide**](https://github.com/frissyn/valorant.py/blob/master/.github/CONTRIBUTING.md) page. diff --git a/tests/client/test_account.py b/tests/client/test_account.py index 8a002cc..3eb6df5 100644 --- a/tests/client/test_account.py +++ b/tests/client/test_account.py @@ -11,11 +11,12 @@ def test_account(self): "_7wNdRyj4cljexSBoGCESzJglohUbAM4H5kw" ) - self.assertEqual(getattr(acc, "gameName", None), "frissyn") self.assertIsInstance(acc, valorant.AccountDTO) + self.assertEqual(getattr(acc, "gameName", None), "frissyn") def test_account_by_name(self): - acc = self.client.get_user_by_name("frissyn#6969") + # Using my static alternate account. + acc = self.client.get_user_by_name("friss#sick") - self.assertEqual(getattr(acc, "gameName", None), "frissyn") self.assertIsInstance(acc, valorant.AccountDTO) + self.assertEqual(getattr(acc, "gameName", None), "friss") diff --git a/valorant/objects/match.py b/valorant/objects/match.py index 895772d..ced66bf 100644 --- a/valorant/objects/match.py +++ b/valorant/objects/match.py @@ -125,7 +125,13 @@ class PlayerRoundStatsDTO(DTO): def __init__(self, obj): super().__init__(obj) - + + self.kills = ContentList( + KillDTO(k) for k in obj["kills"] + ) + self.damage = ContentList( + DamageDTO(d) for d in obj["damage"] + ) self.economy = EconomyDTO(obj["economy"]) self.ability = AbilityDTO(obj["ability"]) @@ -144,7 +150,7 @@ class RoundResultDTO(DTO): defuseRoundTime: int defusePlayerLocations: t.Optional[t.List[PlayerLocationsDTO]] defuseLocation: LocationDTO - playerStats: t.List[PlayerStatsDTO] + playerStats: t.List[PlayerRoundStatsDTO] roundResultCode: str def __init__(self, obj): diff --git a/valorant/objects/player.py b/valorant/objects/player.py index b737f72..2038d87 100644 --- a/valorant/objects/player.py +++ b/valorant/objects/player.py @@ -81,11 +81,12 @@ class PlayerDTO(DTO): competitiveTier: int playerCard: str playerTitle: str + accountLevel: int def __init__(self, obj): super().__init__(obj) - self.stats = PlayerDTO.optional(obj.get("stats")) + self.stats = PlayerStatsDTO.optional(obj.get("stats")) if obj.get("competitiveTier"): self.rank = Lex.RANKS[self.competitiveTier]