【问题标题】:Is there a way to embed this discord message discord bot python有没有办法嵌入这个不和谐的消息 discord bot python
【发布时间】:2021-06-20 16:33:40
【问题描述】:

我一直在努力嵌入这条消息,它目前从 python 项目的路径中获取图像并发送它们,但我想像这样嵌入它们:

标题是图片: 描述正在享受! 并且彩色侧栏为红色

Example of image

当前代码:


@client.command()
async def image(channel):
    file = random.choice(files)
    await channel.send(file=discord.File(file))

【问题讨论】:

    标签: python discord discord.py bots


    【解决方案1】:

    在简单地询问要做什么之前,您需要阅读有关嵌入的更多信息。

    @client.command()
    async def image(channel):
        file = random.choice(files)
        embed = discord.Embed(title="", description="Enjoy!", color=discord.Color.red())
        embed.set_image(url=file)
        await channel.send(embed=embed)
    

    【讨论】:

      猜你喜欢
      • 2021-08-12
      • 2019-12-12
      • 1970-01-01
      • 2020-12-30
      • 2021-03-13
      • 2021-06-25
      • 2020-06-10
      • 2021-12-03
      • 2023-04-10
      相关资源
      最近更新 更多