Show deck problem, if there is one
This commit is contained in:
parent
cba33c9470
commit
e4deb176a9
12
ahtcg_bot.py
12
ahtcg_bot.py
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user