我正在制作一个不和谐的机器人,它用用户的头像、成员 ID 和日期来回复命令,但问题是,它把图像放在嵌入的底部,我想把它放在嵌入之间标题和 ID/日期字段。我该怎么做?
我的代码:
import datetime
bot = discord.Client()
token = 'haha'
@bot.event
async def on_ready():
print(f'{bot.user} has connected to Discord!')
@bot.event
async def on_message(message):
if message.content.startswith('$test'):
teste = message.author.mention
authorId = message.author.id
tempo = datetime.date.today().strftime("%d/%m/%Y")
avatar = message.author.avatar_url_as(format='jpg', static_format='webp', size=2048)
embed=discord.Embed(name="title", description=f"\U0001F5BC {teste} **alterou o avatar**", color=message.author.colour)
embed.set_image(url=avatar)
embed.add_field(name=f"ID do usuário: {authorId} • {tempo}", value="")
await message.channel.send(embed=embed)
bot.run(token)
答案 0 :(得分:0)
这是 Discord 嵌入的一个更普遍的问题 - 布局有些固定。
您要么有字段,要么没有。
来自 discord.js guide 的这张插图做得很好:
所以你必须满足于其中之一:
set_thumbnail
设置缩略图以使其显示在右侧。set_image
并使用 set_footer
将您的信息填入页脚。