Handle null XP values

This commit is contained in:
Adam Goldsmith 2022-03-14 03:00:34 -04:00
parent 3b3962ec9a
commit 877d0426a3
2 changed files with 6 additions and 5 deletions

View File

@ -92,9 +92,10 @@ class ArkhamDBUpdater(commands.Bot):
status = f"{prefix}[{deck['name']}]({url}) [{deck['id']}]"
issues = []
unspent_xp = deck["xp"] - deck["xp_spent"]
if unspent_xp > 0:
issues.append(f"{unspent_xp} unspent XP")
if deck["xp"] is not None:
unspent_xp = deck["xp"] - deck["xp_spent"]
if unspent_xp > 0:
issues.append(f"{unspent_xp} unspent XP")
if deck["problem"] is not None:
issues.append(deck["problem"])

View File

@ -21,8 +21,8 @@ class ArkhamDBDeck(TypedDict):
sideSlots: Union[list[str], dict[str, int]]
ignoreDeckLimitSlots: Optional[str]
version: str
xp: int
xp_spent: int
xp: Optional[int]
xp_spent: Optional[int]
xp_adjustment: int
exile_string: Optional[str]
taboo_id: int