modules/informational.py
async def userinfo(self, ctx, user: discord.Member=None):
        """Shows information on a user or yourself."""
        if user is None:
            user = ctx.author

        try:
            playing = user.activity.name
        except:
            playing = "None"

        Status = {
            "online": "Online",
            "idle": "Idle",
            "dnd": "Do Not Disturb",
            "offline": "Offline/Invisible"
        }

        if user.roles[1:]:
            roles = ", ".join(sorted([x.name for x in user.roles][1:], key=[x.name for x in ctx.guild.roles[::-1][:-1]].index))
        else:
            roles = "No Roles"

        embed = discord.Embed(colour=3553599)
        embed.set_author(name=f"{user} ({user.id})", icon_url=user.avatar_url)
        embed.set_thumbnail(url=user.avatar_url)
        embed.add_field(
            name="Nickname",
            value=user.nick if user.nick else "None",
            inline=True
        )
        embed.add_field(
            name="Is Bot?",
            value=str(user.bot),
            inline=True
        )
        embed.add_field(
            name="Status",
            value=Status[str(user.status)],
            inline=True
        )
        embed.add_field(
            name="Playing",
            value=playing,
            inline=True
        )
        embed.add_field(
            name="Mutual Servers",
            value=str(len(list(filter(lambda u: u.id == user.id, self.bot.get_all_members())))),
            inline=True
        )
        embed.add_field(
            name="Joined at",
            value=f"{user.joined_at.strftime('%-I:%M %p %d/%m/%Y')}\n{self.delta(datetime.utcnow() - user.joined_at)} ago",
            inline=False
        )
        embed.add_field(
            name="Created at",
            value=f"{user.created_at.strftime('%-I:%M %p %d/%m/%Y')}\n{self.delta(datetime.utcnow() - user.created_at)} ago",
            inline=False
        )
        embed.add_field(
            name=f"{len(user.roles[1:])} Roles",
            value=roles,
            inline=False
        )

        await ctx.send(embed=embed)
Shows information on a user or yourself.
Shows information on a user or yourself.
Shows information on a user or yourself .
async def userinfo(self, ctx, user: discord.Member=None):
        if user is None:
            user = ctx.author
        try:
            playing = user.activity.name
        except:
            playing = "None"
        Status = {
            "online": "Online",
            "idle": "Idle",
            "dnd": "Do Not Disturb",
            "offline": "Offline/Invisible"
        }
        if user.roles[1:]:
            roles = ", ".join(sorted([x.name for x in user.roles][1:], key=[x.name for x in ctx.guild.roles[::-1][:-1]].index))
        else:
            roles = "No Roles"
        embed = discord.Embed(colour=3553599)
        embed.set_author(name=f"{user} ({user.id})", icon_url=user.avatar_url)
        embed.set_thumbnail(url=user.avatar_url)
        embed.add_field(
            name="Nickname",
            value=user.nick if user.nick else "None",
            inline=True
        )
        embed.add_field(
            name="Is Bot?",
            value=str(user.bot),
            inline=True
        )
        embed.add_field(
            name="Status",
            value=Status[str(user.status)],
            inline=True
        )
        embed.add_field(
            name="Playing",
            value=playing,
            inline=True
        )
        embed.add_field(
            name="Mutual Servers",
            value=str(len(list(filter(lambda u: u.id == user.id, self.bot.get_all_members())))),
            inline=True
        )
        embed.add_field(
            name="Joined at",
            value=f"{user.joined_at.strftime('%-I:%M %p %d/%m/%Y')}\n{self.delta(datetime.utcnow() - user.joined_at)} ago",
            inline=False
        )
        embed.add_field(
            name="Created at",
            value=f"{user.created_at.strftime('%-I:%M %p %d/%m/%Y')}\n{self.delta(datetime.utcnow() - user.created_at)} ago",
            inline=False
        )
        embed.add_field(
            name=f"{len(user.roles[1:])} Roles",
            value=roles,
            inline=False
        )
        await ctx.send(embed=embed)
async def userinfo ( self , ctx , user : discord . Member = None ) : if user is None : user = ctx . author try : playing = user . activity . name except : playing = "None" Status = { "online" : "Online" , "idle" : "Idle" , "dnd" : "Do Not Disturb" , "offline" : "Offline/Invisible" } if user . roles [ 1 : ] : roles = ", " . join ( sorted ( [ x . name for x in user . roles ] [ 1 : ] , key = [ x . name for x in ctx . guild . roles [ : : - 1 ] [ : - 1 ] ] . index ) ) else : roles = "No Roles" embed = discord . Embed ( colour = 3553599 ) embed . set_author ( name = f"{user} ({user.id})" , icon_url = user . avatar_url ) embed . set_thumbnail ( url = user . avatar_url ) embed . add_field ( name = "Nickname" , value = user . nick if user . nick else "None" , inline = True ) embed . add_field ( name = "Is Bot?" , value = str ( user . bot ) , inline = True ) embed . add_field ( name = "Status" , value = Status [ str ( user . status ) ] , inline = True ) embed . add_field ( name = "Playing" , value = playing , inline = True ) embed . add_field ( name = "Mutual Servers" , value = str ( len ( list ( filter ( lambda u : u . id == user . id , self . bot . get_all_members ( ) ) ) ) ) , inline = True ) embed . add_field ( name = "Joined at" , value = f"{user.joined_at.strftime('%-I:%M %p %d/%m/%Y')}\n{self.delta(datetime.utcnow() - user.joined_at)} ago" , inline = False ) embed . add_field ( name = "Created at" , value = f"{user.created_at.strftime('%-I:%M %p %d/%m/%Y')}\n{self.delta(datetime.utcnow() - user.created_at)} ago" , inline = False ) embed . add_field ( name = f"{len(user.roles[1:])} Roles" , value = roles , inline = False ) await ctx . send ( embed = embed )
Shows information on a user or yourself.
Shows information on a user or yourself .
"""Shows information on a user or yourself."""
self
ctx
user
discord.Member