From c5ea9232c0efee0387db1b7c22a7e11ff52dcdd4 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 29 May 2020 13:37:33 +0200 Subject: [PATCH] Supporta custom status in /cv --- royalpack/commands/cv.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/royalpack/commands/cv.py b/royalpack/commands/cv.py index 9efdeefe..3dbb3d4d 100644 --- a/royalpack/commands/cv.py +++ b/royalpack/commands/cv.py @@ -77,8 +77,15 @@ class CvCommand(Command): activity += f" | 📺 {mact['name']}" # Custom Status elif mact["type"] == 4: - if "state" in activity: - activity += f" | ❓ {mact['state']}" + if "emoji" in mact: + emoji = f"{mact['emoji']['name']}" + else: + emoji = f"❓" + if "state" in mact: + state = f" {mact['state']}" + else: + state = "" + activity += f" | {emoji}{state}" else: raise ExternalError(f"Unknown Discord activity type: {mact['type']}")