Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @bot.command()
- async def userinfo(self, ctx, member: discord.Member = None):
- if member is None:
- mentions = []
- roleList = ctx.author.roles
- roleList.reverse()
- for roles in roleList:
- roles.mention
- joinedRoles = " ".join(mentions)
- mentions.append(roles.mention)
- #Header and Footer of embed
- embed = discord.Embed(title="User Info", timestamp=ctx.message.created_at, color=0x00ffff)
- embed.set_author(name=f"{ctx.author.name} | {ctx.author.id}", icon_url=f"{ctx.author.avatar_url}")
- embed.set_footer(text=f"Requested By {ctx.author}")
- #Body of embed
- embed.add_field(name=f"User Info", value=f"**Profile:** {ctx.author.mention} \n**Created at:** {ctx.author.created_at}")
- embed.add_field(name="Role Info", value=f"**All roles:** {joinedRoles} \n**Top Role:** {ctx.author.top_role.mention}")
- embed.add_field(name="Is Bot?", value=f"{ctx.author.bot}")
- #Left these here because unsure if you still wanted these vvvv
- #embed.add_field(name="Created on:", value=member.created_at.strftime("%a, %#d %B %Y, %T:%M %p UTC"))
- #embed.add_field(name="Joined On:", value=member.joined_at.strftime("%a, %#d %B %Y, %T:%M %p UTC"))
- await ctx.send(embed=embed)
- else:
- mentions = []
- roleList = member.roles
- roleList.reverse()
- for roles in roleList:
- roles.mention
- joinedRoles = " ".join(mentions)
- mentions.append(roles.mention)
- #Header and Footer of embed
- embed = discord.Embed(title="Userinfo", timestamp=ctx.message.created_at, color=0x00ffff)
- embed.set_author(name=f"{member.name} | {member.id}", icon_url=f"{member.avatar_url}")
- embed.set_footer(text=f"Requested By {ctx.author}")
- #Body of embed
- embed.add_field(name=f"User Info", value=f"**Profile:** {member.mention} \n**Created at:** {member.created_at}")
- embed.add_field(name="Role Info", value=f"**All roles:** {joinedRoles} \n**Top Role:** {member.top_role.mention}", inline=False)
- embed.add_field(name="Bot?", value=f"{member.bot}")
- await ctx.send(embed=embed)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement