From 19ff2ffd46771256a06ebda0a5879ced3f6e84ef Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sun, 25 Mar 2018 19:28:36 +0000 Subject: [PATCH] Fix game not showing and string the user id --- discordbot/titanembeds/socketio/socketiointerface.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/discordbot/titanembeds/socketio/socketiointerface.py b/discordbot/titanembeds/socketio/socketiointerface.py index 3f5389f..e5682bc 100644 --- a/discordbot/titanembeds/socketio/socketiointerface.py +++ b/discordbot/titanembeds/socketio/socketiointerface.py @@ -68,7 +68,7 @@ class SocketIOInterface: "discriminator": user.discriminator, "game": None, "hoist-role": None, - "id": user.id, + "id": str(user.id), "status": str(user.status), "username": user.name, "nick": None, @@ -79,9 +79,9 @@ class SocketIOInterface: # userobj["avatar_url"] = userobj["avatar_url"][:len(userobj["avatar_url"])-14] + ".jpg" if user.nick: userobj["nick"] = user.nick - if hasattr(user, "game"): - userobj["game"] = { - "name": user.game.name + if hasattr(user, "activity") and user.activity: + userobj["activity"] = { + "name": user.activity.name } roles = sorted(user.roles, key=lambda k: k.position, reverse=True) for role in roles: