1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Supporta custom status in /cv

This commit is contained in:
Steffo 2020-05-29 13:37:33 +02:00
parent e6f1cd5e9d
commit c5ea9232c0
Signed by: steffo
GPG key ID: 896A80F55F7C97F0

View file

@ -77,8 +77,15 @@ class CvCommand(Command):
activity += f" | 📺 {mact['name']}" activity += f" | 📺 {mact['name']}"
# Custom Status # Custom Status
elif mact["type"] == 4: elif mact["type"] == 4:
if "state" in activity: if "emoji" in mact:
activity += f" | ❓ {mact['state']}" emoji = f"{mact['emoji']['name']}"
else:
emoji = f""
if "state" in mact:
state = f" {mact['state']}"
else:
state = ""
activity += f" | {emoji}{state}"
else: else:
raise ExternalError(f"Unknown Discord activity type: {mact['type']}") raise ExternalError(f"Unknown Discord activity type: {mact['type']}")