[V3 General] Updated userinfo (#1289)

Updated userinfo to include new statuses
This commit is contained in:
Kowlin 2018-02-09 23:18:06 +01:00 committed by palmtree5
parent 194981cd8b
commit 11636b16d2

View File

@ -202,7 +202,7 @@ class General:
special_date = datetime.datetime(2016, 1, 10, 6, 8, 4, 443000)
is_special = (user.id == 96130341705637888 and
guild.id == 133049272517001216)
roles = sorted(user.roles)[1:]
joined_at = user.joined_at if not is_special else special_date
@ -218,10 +218,15 @@ class General:
game = _("Chilling in {} status").format(user.status)
if user.game and user.game.name and user.game.url:
game = _("Streaming: [{}]({})").format(user.game, user.game.url)
elif user.game and user.game.name:
game = _("Playing {}").format(user.game)
# Check if the user has a special status
if user.game.type == 0: # "Playing" status
game = _("Playing {}").format(user.game.name)
elif user.game.type == 1: # "Streaming" status
game = _("Streaming [{}]({})").format(user.game.name, user.game.url)
elif user.game.type == 2: # "Listening" status
game = _("Listening to {}").format(user.game.name)
elif user.game.type == 3: # "Watching" status
game = _("Watching {}").format(user.game.name)
if roles:
roles = ", ".join([x.name for x in roles])