Include encounter cards when getting card information
This commit is contained in:
parent
8904d521cd
commit
5d96211700
@ -131,7 +131,7 @@ class ArkhamDBUpdater(commands.Bot):
|
|||||||
title=f"Updated as of {datetime.now()}", description=message_text
|
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)
|
validator = Validator(cards)
|
||||||
validation_errors = list(
|
validation_errors = list(
|
||||||
validator.validate([deck for _, deck in latest_decks.values()])
|
validator.validate([deck for _, deck in latest_decks.values()])
|
||||||
|
@ -45,8 +45,11 @@ class ArkhamDBClient:
|
|||||||
async def close(self) -> None:
|
async def close(self) -> None:
|
||||||
await self._session.close()
|
await self._session.close()
|
||||||
|
|
||||||
async def get_cards(self) -> list[ArkhamDBCard]:
|
async def get_cards(self, encounter=False) -> list[ArkhamDBCard]:
|
||||||
async with self._session.get(self.origin + "/api/public/cards/") as resp:
|
async with self._session.get(
|
||||||
|
self.origin + "/api/public/cards/",
|
||||||
|
params={"encounter": "1"} if encounter else {},
|
||||||
|
) as resp:
|
||||||
return await resp.json()
|
return await resp.json()
|
||||||
|
|
||||||
async def get_latest_deck(self, deck_id: int) -> ArkhamDBDeck:
|
async def get_latest_deck(self, deck_id: int) -> ArkhamDBDeck:
|
||||||
|
Loading…
Reference in New Issue
Block a user