From e4deb176a96db09b90322249ca0e79812be284c1 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 14 Mar 2022 01:21:53 -0400 Subject: [PATCH] Show deck problem, if there is one --- ahtcg_bot.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ahtcg_bot.py b/ahtcg_bot.py index cb951b2..a7b2578 100755 --- a/ahtcg_bot.py +++ b/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