发送一条消息并嵌入1条命令(Discord.py)

时间:2018-08-18 03:09:09

标签: python-3.x discord.py

我正在尝试将嵌入的照片发送给不和谐的人,并在其之前发送消息。我尝试了几件事,但似乎无法掌握。

if message.author == client.user:
    return
elif message.content.startswith('!brando'):
    embed = discord.Embed(title="", description="", color=0x32363c)
    embed.set_image(url="embed IMAGEURLHERE.PNG")
    await client.send_message(message.channel + embed=embed +"<@!368718923123456789>s photo!")

1 个答案:

答案 0 :(得分:3)

再看看Client.send_message文档。您需要分别为其提供参数destinationcontentembed,而不是将它们加在一起。

@client.event
async def on_message(message):
    if message.author == client.user:
        return
    elif message.content.startswith('!brando'):
        embed = discord.Embed(title="", description="", color=0x32363c)
        embed.set_image(url="ImageUrl")
        await client.send_message(message.channel, "<@!368718923123456789>s photo!", embed=embed)
相关问题