` @commands.command(aliases=['ava', 'аватарка']) async def avatar(self, ctx, *, member: discord.Member = None): if not member: member = ctx.message.author userAvatar = member.avatar

        embed = discord.Embed(color=discord.Color.darker_grey(), timestamp=ctx.message.created_at)
        embed.set_author(name=f'Аватар {member}')
        embed.set_image(url=member.avatar)
        embed.set_footer(text=f'Выполнено {ctx.author}', icon_url=ctx.author.avatar)
        await ctx.send(embed=embed)
    if member:
        embed = discord.Embed(color=discord.Color.darker_grey(), timestamp=ctx.message.created_at)
        embed.set_author(name=f'Аватар {member}')
        embed.set_image(url=member.avatar)
        embed.set_footer(text=f'Выполнено {ctx.author}', icon_url=ctx.author.avatar)
        await ctx.send(embed=embed)`
1

There are 1 best solutions below

0
sicco14 On BEST ANSWER

I don't really understand what you need that member check for.. because everyone who can use a command is already a member on your discord or am I wrong? Maybe this will work for you?:

@commands.command(aliases=['ava', 'аватарка'])
async def avatar(self, ctx):

    author = ctx.message.author

    if author.avatar is None:
        await ctx.send('The author has no avatar!')
    else:
        embed = discord.Embed(color=discord.Color.darker_grey(), timestamp=ctx.message.created_at)
        embed.set_author(name=f'Аватар {author.name}')
        embed.set_image(url=author.avatar)
        embed.set_footer(text=f'Выполнено {author.name}',icon_url=ctx.author.avatar)
        await ctx.send(embed=embed)