Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. @bot.command()
  2. async def userinfo(self, ctx, member: discord.Member = None):
  3. if member is None:
  4. mentions = []
  5. roleList = ctx.author.roles
  6. roleList.reverse()
  7. for roles in roleList:
  8. roles.mention
  9. joinedRoles = " ".join(mentions)
  10. mentions.append(roles.mention)
  11.  
  12. #Header and Footer of embed
  13. embed = discord.Embed(title="User Info", timestamp=ctx.message.created_at, color=0x00ffff)
  14. embed.set_author(name=f"{ctx.author.name} | {ctx.author.id}", icon_url=f"{ctx.author.avatar_url}")
  15. embed.set_footer(text=f"Requested By {ctx.author}")
  16.  
  17. #Body of embed
  18. embed.add_field(name=f"User Info", value=f"**Profile:** {ctx.author.mention} \n**Created at:** {ctx.author.created_at}")
  19. embed.add_field(name="Role Info", value=f"**All roles:** {joinedRoles} \n**Top Role:** {ctx.author.top_role.mention}")
  20. embed.add_field(name="Is Bot?", value=f"{ctx.author.bot}")
  21.  
  22. #Left these here because unsure if you still wanted these vvvv
  23. #embed.add_field(name="Created on:", value=member.created_at.strftime("%a, %#d %B %Y, %T:%M %p UTC"))
  24. #embed.add_field(name="Joined On:", value=member.joined_at.strftime("%a, %#d %B %Y, %T:%M %p UTC"))
  25.  
  26. await ctx.send(embed=embed)
  27. else:
  28. mentions = []
  29. roleList = member.roles
  30. roleList.reverse()
  31. for roles in roleList:
  32. roles.mention
  33. joinedRoles = " ".join(mentions)
  34. mentions.append(roles.mention)
  35.  
  36. #Header and Footer of embed
  37. embed = discord.Embed(title="Userinfo", timestamp=ctx.message.created_at, color=0x00ffff)
  38. embed.set_author(name=f"{member.name} | {member.id}", icon_url=f"{member.avatar_url}")
  39. embed.set_footer(text=f"Requested By {ctx.author}")
  40.  
  41. #Body of embed
  42. embed.add_field(name=f"User Info", value=f"**Profile:** {member.mention} \n**Created at:** {member.created_at}")
  43. embed.add_field(name="Role Info", value=f"**All roles:** {joinedRoles} \n**Top Role:** {member.top_role.mention}", inline=False)
  44. embed.add_field(name="Bot?", value=f"{member.bot}")
  45. await ctx.send(embed=embed)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement