小编Ted*_*ddy的帖子

从设置的用户获取个人资料图片

我希望让我的机器人使用硬编码的用户个人资料图片回复我的命令。

这是我现在拥有的代码,因为它回复 message.author 的 pfp,我想知道是否以及如何替换user = message.author 它以针对硬编码用户。

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) `
Run Code Online (Sandbox Code Playgroud)

我也知道,如果我切换到“for user in message.mentions”,我可以让它弹出提到的用户的 pfp,但同样,我希望能够在不提及任何人的情况下做到这一点。

感谢您的时间和提出的任何答案!

python discord discord.py

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

discord ×1

discord.py ×1

python ×1