-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Getting user info in a DM doesn't work #46
Comments
How are you using the command? |
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 |
Yes |
OK, thanks, I'll try this out |
Your way still isn't working for me @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 |
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.
The text was updated successfully, but these errors were encountered: