0
votes

I want to create a userinfo command but i still get a error "embed.set_author(name=f"User Info - {member}") IndentationError: unexpected indent" i dont know if thats enough to understand where my mistake is (i just started with coding)

@client.command() async def info(ctx, member: discord.Member):

    embed = discord.Embed(colour=member.color, timestamp=ctx.message.created_at)
                    
            embed.set_author(name=f"User Info - {member}")
            embed.add_field(name="ID", value=member.id)
            embed.add_field(name="Name", value=member.display_name)
            embed.add_field(name="Activity", value=member.activity)
        
            embed.set_thumbnail(url=member.avatar_url)
            embed.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar_url)
            
            embed.add_field(name="Joined at", value=member.joined_at.strftime("%d/%m/%Y, %H:%M:%S"), inline=True)
            embed.add_field(name="Created at", value=member.created_at.strftime("%d/%m/%Y, %H:%M:%S"), inline=True)
await ctx.send(embed=embed)
1

1 Answers

0
votes

For an IndentationError the way you formatted the code is the problem. Try this:

embed = discord.Embed(colour=member.color, timestamp=ctx.message.created_at)
                    
embed.set_author(name=f"User Info - {member}")
embed.add_field(name="ID", value=member.id)
embed.add_field(name="Name", value=member.display_name)
embed.add_field(name="Activity", value=member.activity)
        
embed.set_thumbnail(url=member.avatar_url)
embed.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar_url)
            
embed.add_field(name="Joined at", value=member.joined_at.strftime("%d/%m/%Y, %H:%M:%S"), inline=True)
embed.add_field(name="Created at", value=member.created_at.strftime("%d/%m/%Y, %H:%M:%S"), inline=True)
await ctx.send(embed=embed)

Hope this may be of help.