diff --git a/valorant/client.py b/valorant/client.py index 494c236..f6c88a5 100644 --- a/valorant/client.py +++ b/valorant/client.py @@ -120,8 +120,16 @@ async def fetch_agent(self, uuid: str, /, *, language: LanguageOption | None = N agent = Response[Agent].model_validate(data) return agent.data - async def fetch_agents(self, *, language: LanguageOption | None = None) -> list[Agent]: - data = await self.http.get_agents(language=language or self.language) + async def fetch_agents( + self, + *, + language: LanguageOption | None = None, + is_playable_character: bool | None = None, + ) -> list[Agent]: + data = await self.http.get_agents( + language=language or self.language, + is_playable_character=is_playable_character, + ) agents = Response[list[Agent]].model_validate(data) return agents.data diff --git a/valorant/http.py b/valorant/http.py index ec70fc0..60eb88d 100644 --- a/valorant/http.py +++ b/valorant/http.py @@ -126,10 +126,17 @@ def clear(self) -> None: # valorant-api.com - def get_agents(self, *, language: str | None = None, is_playable_character: bool = True) -> Response[Any]: - params = {'isPlayableCharacter': str(is_playable_character)} + def get_agents( + self, + *, + language: str | None = None, + is_playable_character: bool | None = None, + ) -> Response[Any]: + params = {} if language is not None: params['language'] = language + if is_playable_character is not None: + params['isPlayableCharacter'] = str(is_playable_character) return self.request(Route('GET', '/agents'), params=params) def get_agent(self, uuid: str, *, language: str | None = None) -> Response[Any]: