why is this not replying to the user with the embed?
Everything except the error reply works, it does not reply but still spits out an error in the terminal. I’ve also tried if member not in discord.Guild.members, it did not work.
@commands.hybrid_command(name = 'avatar', description = 'Replies with the avatar of the specified user.', aliases = ["av"])
async def avatar(self, ctx: Context, user: discord.User = None):
if not user:
user = ctx.author
elif isinstance(user, str):
member: discord.Member = discord.Guild.get_member_named(user)
if not member:
embed = discord.Embed(description="User not found.", color=0x000000)
await ctx.reply(embed=embed)
return
user = member
embed = discord.Embed(colour=0x000000)
embed.set_image(url=user.display_avatar.url)
embed.set_footer(text = f"Requested by {ctx.author}", icon_url = f"{ctx.author.display_avatar.url}")
embed.set_author(name = "Avatar", icon_url = "https://cdn.discordapp.com/attachments/1227635059994001470/1228843317509488650/411_logo.png?ex=6636bf05&is=66244a05&hm=bf046870e7ae396e33f3aaeed28e35d06e1864a2d03b6292e00888b7528ef751&")
av_button = discord.ui.Button(label="Download", url=user.display_avatar.url, emoji = '⬇️')
view = discord.ui.View()
view.add_item(av_button)
await ctx.send(embed=embed, view=view)