我对不和谐的机器人还很陌生,如果有人可以告诉我如何发出“嵌入”消息,我很想知道,例如:
这是我使用的代码:
@client.event async def on_message(message):
if message.content == "=displayembed":
embed = discord.Embed(
title = "Title",
description = "This is a description",
colour = discord.Colour.blue()
)
embed.set_footer(text="This is a footer.")
embed.set_image(url="https://cdn.discordapp.com/attachments/520265639680671747/533389224913797122/rtgang.jpeg")
embed.set_thumbnail(url="https://cdn.discordapp.com/attachments/520265639680671747/533389224913797122/rtgang.jpeg")
embed.set_author(name="Author Name", icon_url="https://cdn.discordapp.com/attachments/520265639680671747/533389224913797122/rtgang.jpeg")
embed.add_field(name="Field Name", value="Field Value", inline=False)
embed.add_field(name="Field Name", value="Field Value", inline=True)
embed.add_field(name="Field Name", value="Field Value", inline=True)
await client.say(embed=embed)
答案 0 :(得分:1)
@client.event
async def on_message(message):
if message.content == "=displayembed":
embed = discord.Embed(
title = "Title",
description = "This is a description",
colour = discord.Colour.blue()
)
embed.set_footer(text="This is a footer.")
embed.set_image(url="https://cdn.discordapp.com/attachments/520265639680671747/533389224913797122/rtgang.jpeg")
embed.set_thumbnail(url="https://cdn.discordapp.com/attachments/520265639680671747/533389224913797122/rtgang.jpeg")
embed.set_author(name="Author Name", icon_url="https://cdn.discordapp.com/attachments/520265639680671747/533389224913797122/rtgang.jpeg")
embed.add_field(name="Field Name", value="Field Value", inline=False)
embed.add_field(name="Field Name", value="Field Value", inline=True)
embed.add_field(name="Field Name", value="Field Value", inline=True)
await client.send_message(message.channel, embed=embed)`