Handle null XP values
This commit is contained in:
parent
3b3962ec9a
commit
877d0426a3
@ -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"])
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user