Advertisement
swimmerhair

Swimbot Error

Jan 26th, 2023
666
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. Traceback (most recent call last):
  2.   File "/home/pi/.local/lib/python3.7/site-packages/discord/ext/commands/core.py", line 85, in wrapped
  3.     ret = await coro(*args, **kwargs)
  4.   File "/home/pi/Swimbot/whois.py", line 294, in whois
  5.     embed.set_footer(text=f"Requested by {ctx.message.author.name}", icon_url= ctx.message.guild.get_member(ctx.message.author.id).avatar_url)
  6. AttributeError: 'NoneType' object has no attribute 'avatar_url'
  7.  
Advertisement
Comments
  • MrLunk
    1 year
    # text 0.78 KB | 0 0
    1. This error message is indicating that an AttributeError occurred in the file "/home/pi/Swimbot/whois.py" on line 294. Specifically, the error is that a 'NoneType' object (an object that does not have a value) does not have an attribute called 'avatar_url'.
    2.  
    3. It seems the code is trying to access the avatar_url attribute of a discord member object. But the object returned by ctx.message.guild.get_member(ctx.message.author.id) is None, so it cannot access the attribute.
    4.  
    5. It is likely that the member is not found in the guild, and thus ctx.message.guild.get_member(ctx.message.author.id) return None.
    6. You should check the code before this line and make sure the member exists in the guild before trying to access its avatar_url.
    7.  
    8. According to CHatGPT.
    9.  
    10. Just playing...
    11. Greetings, MrLunk
Add Comment
Please, Sign In to add comment
Advertisement