#need help ith avatar.url

1 messages · Page 1 of 1 (latest)

golden halo
#

This is my embed the user is discord.Member i get this over a slash command

embed = discord.Embed(title=f"**Profile Inroamtion**",description=f"Here a {user_name}#{user_discriminator} Account Inforamtion",color=int(get_config("colors")["green"], 16))
                embed.add_field(name=f"**Money Balance**", value=f"{result[0]}", inline=True)
                embed.add_field(name=f"**Bank Balance**", value=f"{result1[0]}", inline=True)
                embed.set_thumbnail(url=f"{user.avatar.url}")
                return await ctx.respond(embed=embed)```
#

i dont can put the user pci in the emebed

My Error

Traceback (most recent call last):
  File "C:\Users\jurek\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 126, in wrapped
    ret = await coro(arg)
  File "C:\Users\jurek\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 852, in _invoke
    await self.callback(self.cog, ctx, **kwargs)
  File "C:\Users\jurek\Documents\Development\DiscordBots\PY\NewModrnBotV2 PyCord\cogs\economy.py", line 407, in check
    embed.set_thumbnail(url=f"{user.avatar.url}")
AttributeError: 'NoneType' object has no attribute 'url'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\jurek\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 993, in invoke_application_command
    await ctx.command.invoke(ctx)
  File "C:\Users\jurek\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 357, in invoke
    await injected(ctx)
  File "C:\Users\jurek\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 126, in wrapped
    ret = await coro(arg)
  File "C:\Users\jurek\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 1126, in _invoke
    await command.invoke(ctx)
  File "C:\Users\jurek\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 357, in invoke
    await injected(ctx)
  File "C:\Users\jurek\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 134, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'NoneType' object has no attribute 'url'```
golden halo
golden halo
waxen sail
#

Does it work if you don't provide a user

golden halo
#

yep i become my pic

waxen sail
#

Hm

#

Try printing user

#

On the else statement.

golden halo
#

okay

golden halo