Closed ghost closed 3 years ago
How are you using the command? !test @user
?
I also noticed this problem, but I managed to solve it by getting the context information.
*This is far from ideal, but it worked until the next release came out, which should probably fix the problem.
https://github.com/caiocinel/Selfium/blob/main/app/events/client/commands/avatar.py
How are you using the command?
!test @user
?
Yes
I also noticed this problem, but I managed to solve it by getting the context information.
*This is far from ideal, but it worked until the next release came out, which should probably fix the problem.
https://github.com/caiocinel/Selfium/blob/main/app/events/client/commands/avatar.py
OK, thanks, I'll try this out
I also noticed this problem, but I managed to solve it by getting the context information.
*This is far from ideal, but it worked until the next release came out, which should probably fix the problem.
https://github.com/caiocinel/Selfium/blob/main/app/events/client/commands/avatar.py
Your way still isn't working for me My command:
@Client.command()
async def test123(ctx):
async def byMember(member):
if hasattr(member, 'id'):
targetId = int(member.id)
else:
targetId = member.author.id
return await byID(targetId)
async def byID(id):
target = await Client.fetch_user(int(id))
return target
if(ctx.message.mentions):
target = ctx.message.mentions
else:
target = ctx.args
try:
for t in range(len(target)):
memberFetch = await byMember(target[t])
embed = discord.Embed(colour=discord.Colour.green())
embed.set_author(name=f"🖼️ Here's {memberFetch.display_name} profile picture", url=f"{memberFetch.avatar_url.BASE + memberFetch.avatar_url._url}")
embed.set_image(url=memberFetch.avatar_url.BASE + memberFetch.avatar_url._url)
await ctx.send(embed=embed)
except:
print('not found')
Hope it's not a stupid mistake on my part
Your code worked perfectly in my tests (although it might be better structured), set some breakpoints and see what happens.
Your code worked perfectly in my tests (although it might be better structured), set some breakpoints and see what happens.
Using the development version fixed it for me. Works using your method and the normal method. Thanks for the help
Summary
A simple summary of the bug.
Whenever I try to get the avatar_url of a user in a DM it returns the default discord profile picture, and if I try to get the name of the user it returns 'None'
Reproduction Steps
How did you make it happen?
Code
Relevant code that shows the bug.
Expected Results
What is supposed to happen?
Returns the user's correct tag and avatar
Actual Results
What is currently happening?
Returns 'None' as the user's name and the default discord profile picture as their avatar
System Info
Run
python -m discord --version
and paste the information below.Checklist
Let's make sure this issue is valid!
Additional Information
Put any extra context, weird configurations, or other important info here.