From f978029137a6008b1073772b1f431edb4a0600c7 Mon Sep 17 00:00:00 2001 From: Ske Date: Mon, 15 Apr 2019 12:42:20 +0200 Subject: [PATCH] Add clickable account tags on pk;system card --- src/pluralkit/bot/embeds.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pluralkit/bot/embeds.py b/src/pluralkit/bot/embeds.py index ea184712..48010ed4 100644 --- a/src/pluralkit/bot/embeds.py +++ b/src/pluralkit/bot/embeds.py @@ -97,8 +97,11 @@ async def system_card(conn, client: discord.Client, system: System, is_own_syste account_names = [] for account_id in await system.get_linked_account_ids(conn): - account = await client.get_user_info(account_id) - account_names.append("{}#{}".format(account.name, account.discriminator)) + try: + account = await client.get_user_info(account_id) + account_names.append("{} ({}#{})".format(account_id, account.name, account.discriminator)) + except discord.NotFound: + account_names.append("(deleted account {})".format(account_id)) card.add_field(name="Linked accounts", value=truncate_field_body("\n".join(account_names)))