Show deck problem, if there is one

This commit is contained in:
Adam Goldsmith 2022-03-14 01:21:53 -04:00
parent cba33c9470
commit e4deb176a9
1 changed files with 10 additions and 2 deletions

View File

@ -87,10 +87,18 @@ class ArkhamDBUpdater(commands.Bot):
await message.delete()
def status_for_deck(self, prefix: str, deck: ArkhamDBDeck) -> str:
url = f"{self.arkhamdb_client.origin}/deck/view/{deck['id']}"
status = f"{prefix}[{deck['name']}]({url}) [{deck['id']}]"
issues = []
unspent_xp = deck["xp"] - deck["xp_spent"]
status = f"{prefix}[{deck['name']}]({self.arkhamdb_client.origin}/deck/view/{deck['id']}) [{deck['id']}]"
if unspent_xp > 0:
status += f" {{{unspent_xp} unspent XP}}"
issues.append(f"{unspent_xp} unspent XP")
if deck["problem"] is not None:
issues.append(deck["problem"])
if issues:
status += f"***{', '.join(issues)}***"
return status