Include encounter cards when getting card information

This commit is contained in:
Adam Goldsmith 2022-04-02 12:16:42 -04:00
parent 8904d521cd
commit 5d96211700
2 changed files with 6 additions and 3 deletions

View File

@ -131,7 +131,7 @@ class ArkhamDBUpdater(commands.Bot):
title=f"Updated as of {datetime.now()}", description=message_text
)
cards = await self.arkhamdb_client.get_cards()
cards = await self.arkhamdb_client.get_cards(encounter=True)
validator = Validator(cards)
validation_errors = list(
validator.validate([deck for _, deck in latest_decks.values()])

View File

@ -45,8 +45,11 @@ class ArkhamDBClient:
async def close(self) -> None:
await self._session.close()
async def get_cards(self) -> list[ArkhamDBCard]:
async with self._session.get(self.origin + "/api/public/cards/") as resp:
async def get_cards(self, encounter=False) -> list[ArkhamDBCard]:
async with self._session.get(
self.origin + "/api/public/cards/",
params={"encounter": "1"} if encounter else {},
) as resp:
return await resp.json()
async def get_latest_deck(self, deck_id: int) -> ArkhamDBDeck: