【问题标题】:Discord.py - edit a message the bot has sentDiscord.py - 编辑机器人发送的消息
【发布时间】:2020-10-10 17:56:46
【问题描述】:

我想编辑已使用机器人发送的嵌入。 我知道您可以编辑消息,但是嵌入的情况如何?我只想能够编辑文本,而不是标题。

我对此有所思考:-editembed [ID] [newtext],我开始了一点,但是当我想编辑现有消息时失败了...

谢谢

【问题讨论】:

    标签: python discord discord.py


    【解决方案1】:

    您需要将新的嵌入作为关键字参数传递给编辑函数:

    my_embed = Embed(title="My title", description="My description here")
    message.edit(embed=my_embed)
    

    您可以通过阅读文档自己弄清楚。 阅读更多:https://discordpy.readthedocs.io/en/latest/api.html#discord.Message.edit

    【讨论】:

      猜你喜欢
      • 2020-11-17
      • 1970-01-01
      • 2020-11-04
      • 2022-01-03
      • 2021-10-14
      • 2021-01-26
      • 1970-01-01
      • 2020-12-26
      • 2020-12-03
      相关资源
      最近更新 更多