Fix game not showing and string the user id

This commit is contained in:
Jeremy Zhang 2018-03-25 19:28:36 +00:00
parent c35743b498
commit 19ff2ffd46

View File

@ -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: