I'm looking to get my bot to reply to my command with a hard-coded user's profile picture.
This is the code I have for now, as it is it replies with the message.author's pfp and I'm wondering if and how I could replace the user = message.author
for it to target a hard-coded user.
if message.content.upper().startswith('TEST'):
userID = message.author.id
user = message.author
pfp = user.avatar_url
embed = discord.Embed(
title="test",
description='<@%s>, test' % (userID),
color=0xecce8b
)
embed.set_image(url=pfp)
await client.send_message(message.channel, embed=embed) `
I also know that if I switch to "for user in message.mentions" I can get it to pop out the mentioned user's pfp, but again, I want to be able to do this without mentioning anyone.
Thank you for your time and any answers brought forward!
You can use Server.get_member
to resolve the Member
whom you have the id for.
if message.content.upper().startswith('TEST'):
user = message.server.get_member("116273596605049942") # Fake snowflake, will not work
if not user:
return # Can't find the user, then quit
pfp = user.avatar_url
embed=discord.Embed(title="test", description='{}, test'.format(user.mention) , color=0xecce8b)
embed.set_image(url=(pfp))
await client.send_message(message.channel, embed=embed)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With