Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Head over to the [**Contributing Guide**](https://github.com/frissyn/valorant.py/blob/master/.github/CONTRIBUTING.md) page.
7 changes: 4 additions & 3 deletions tests/client/test_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
10 changes: 8 additions & 2 deletions valorant/objects/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])

Expand All @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion valorant/objects/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down