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']}]"
|
status = f"{prefix}[{deck['name']}]({url}) [{deck['id']}]"
|
||||||
|
|
||||||
issues = []
|
issues = []
|
||||||
unspent_xp = deck["xp"] - deck["xp_spent"]
|
if deck["xp"] is not None:
|
||||||
if unspent_xp > 0:
|
unspent_xp = deck["xp"] - deck["xp_spent"]
|
||||||
issues.append(f"{unspent_xp} unspent XP")
|
if unspent_xp > 0:
|
||||||
|
issues.append(f"{unspent_xp} unspent XP")
|
||||||
if deck["problem"] is not None:
|
if deck["problem"] is not None:
|
||||||
issues.append(deck["problem"])
|
issues.append(deck["problem"])
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ class ArkhamDBDeck(TypedDict):
|
|||||||
sideSlots: Union[list[str], dict[str, int]]
|
sideSlots: Union[list[str], dict[str, int]]
|
||||||
ignoreDeckLimitSlots: Optional[str]
|
ignoreDeckLimitSlots: Optional[str]
|
||||||
version: str
|
version: str
|
||||||
xp: int
|
xp: Optional[int]
|
||||||
xp_spent: int
|
xp_spent: Optional[int]
|
||||||
xp_adjustment: int
|
xp_adjustment: int
|
||||||
exile_string: Optional[str]
|
exile_string: Optional[str]
|
||||||
taboo_id: int
|
taboo_id: int
|
||||||
|
Loading…
Reference in New Issue
Block a user