【发布时间】:2018-12-27 15:54:49
【问题描述】:
我希望我的机器人使用硬编码的用户个人资料图片来回复我的命令。
这是我现在拥有的代码,因为它回复了 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) `
我也知道,如果我切换到“for user in message.mentions”,我可以让它弹出提到的用户的 pfp,但同样,我希望能够在不提及任何人的情况下做到这一点。
感谢您抽出宝贵时间和任何答案!
【问题讨论】:
-
pfp是什么意思?我不熟悉这个词。 -
我的错,它代表“头像”又名:“头像”
-
出于好奇,你为什么要这样做?
-
出于俗气的原因 x:
标签: python discord discord.py