From 8da9487f52795e39590c36635b6820cd263e5cb6 Mon Sep 17 00:00:00 2001 From: Twentysix Date: Mon, 22 Aug 2016 18:40:51 +0200 Subject: [PATCH] More info for [p]userinfo, fix avatar not showing up Embed links in code blocks got fixed by Discord. As a fix, now the avatar URL shows up outside the code block. It might not look great but it's the only solution outside of downloading the avatar and uploading it everytime, which I don't find ideal. --- cogs/general.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cogs/general.py b/cogs/general.py index 7ff94cdc6..868e5074d 100644 --- a/cogs/general.py +++ b/cogs/general.py @@ -165,14 +165,26 @@ class General: if not roles: roles = ["None"] data = "```python\n" data += "Name: {}\n".format(escape_mass_mentions(str(user))) + data += "Nickname: {}\n".format(escape_mass_mentions(str(user.nick))) data += "ID: {}\n".format(user.id) + if user.game is None: + pass + elif user.game.url is None: + data += "Playing: {}\n".format(escape_mass_mentions(str(user.game))) + else: + data += "Streaming: {} ({})\n".format(escape_mass_mentions(str(user.game)), + escape_mass_mentions(user.game.url)) passed = (ctx.message.timestamp - user.created_at).days data += "Created: {} ({} days ago)\n".format(user.created_at, passed) passed = (ctx.message.timestamp - user.joined_at).days data += "Joined: {} ({} days ago)\n".format(user.joined_at, passed) data += "Roles: {}\n".format(", ".join(roles)) - data += "Avatar: {}\n".format(user.avatar_url) - data += "```" + if user.avatar_url != "": + data += "Avatar:" + data += "```" + data += user.avatar_url + else: + data += "```" await self.bot.say(data) @commands.command(pass_context=True, no_pm=True)