<tfoot id='lKR7o'></tfoot>
    <bdo id='lKR7o'></bdo><ul id='lKR7o'></ul>
  • <i id='lKR7o'><tr id='lKR7o'><dt id='lKR7o'><q id='lKR7o'><span id='lKR7o'><b id='lKR7o'><form id='lKR7o'><ins id='lKR7o'></ins><ul id='lKR7o'></ul><sub id='lKR7o'></sub></form><legend id='lKR7o'></legend><bdo id='lKR7o'><pre id='lKR7o'><center id='lKR7o'></center></pre></bdo></b><th id='lKR7o'></th></span></q></dt></tr></i><div id='lKR7o'><tfoot id='lKR7o'></tfoot><dl id='lKR7o'><fieldset id='lKR7o'></fieldset></dl></div>
    1. <small id='lKR7o'></small><noframes id='lKR7o'>

    2. <legend id='lKR7o'><style id='lKR7o'><dir id='lKR7o'><q id='lKR7o'></q></dir></style></legend>

        如何按 ID 检索特定消息(尝试 fetch_message(id))

        时间:2023-09-09

          <tfoot id='L4Fol'></tfoot>

        • <small id='L4Fol'></small><noframes id='L4Fol'>

            <tbody id='L4Fol'></tbody>
            <bdo id='L4Fol'></bdo><ul id='L4Fol'></ul>
            <i id='L4Fol'><tr id='L4Fol'><dt id='L4Fol'><q id='L4Fol'><span id='L4Fol'><b id='L4Fol'><form id='L4Fol'><ins id='L4Fol'></ins><ul id='L4Fol'></ul><sub id='L4Fol'></sub></form><legend id='L4Fol'></legend><bdo id='L4Fol'><pre id='L4Fol'><center id='L4Fol'></center></pre></bdo></b><th id='L4Fol'></th></span></q></dt></tr></i><div id='L4Fol'><tfoot id='L4Fol'></tfoot><dl id='L4Fol'><fieldset id='L4Fol'></fieldset></dl></div>

                  <legend id='L4Fol'><style id='L4Fol'><dir id='L4Fol'><q id='L4Fol'></q></dir></style></legend>
                1. 本文介绍了如何按 ID 检索特定消息(尝试 fetch_message(id))的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  @client.command()
                  async def edit(ctx, message_id, *, new_message) :
                      channel, chan, guild = None, list_channels("saved_channels.csv"), ctx.guild.id
                      message = await fetch_message(message_id)
                      await message.edit(new_message)
                      embed=discord.Embed(color=0x00ca1f)
                      embed.add_field(name="Success :white_check_mark:", value=f"Le message a bien été édité dans {message.channel.mention}", inline=False)
                      await ctx.send(embed = embed)
                  

                  I'm trying to edit a specific message my bot sent in another channel by taking the message id with fetch_message() (supposed to be in the new discord API) but it gives me the NameError: name 'fetch_message' is not defined... is there something I did wrong ?

                  解决方案

                  You need to specify the channel where bot should edit the message from.

                  For example,

                  channel = client.get_channel(channel_id)
                  message = await channel.fetch_message(message_id)
                  

                  Also, when editing a message you need to specify the content as follows:

                  await message.edit(content=new_message)
                  

                  这篇关于如何按 ID 检索特定消息(尝试 fetch_message(id))的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Discord.py 无法获得证书 下一篇:如何让不和谐机器人输出用户输入的所有内容,

                  相关文章

                  最新文章

                  <tfoot id='QKzzu'></tfoot>

                    <small id='QKzzu'></small><noframes id='QKzzu'>

                    <legend id='QKzzu'><style id='QKzzu'><dir id='QKzzu'><q id='QKzzu'></q></dir></style></legend>

                      <i id='QKzzu'><tr id='QKzzu'><dt id='QKzzu'><q id='QKzzu'><span id='QKzzu'><b id='QKzzu'><form id='QKzzu'><ins id='QKzzu'></ins><ul id='QKzzu'></ul><sub id='QKzzu'></sub></form><legend id='QKzzu'></legend><bdo id='QKzzu'><pre id='QKzzu'><center id='QKzzu'></center></pre></bdo></b><th id='QKzzu'></th></span></q></dt></tr></i><div id='QKzzu'><tfoot id='QKzzu'></tfoot><dl id='QKzzu'><fieldset id='QKzzu'></fieldset></dl></div>
                      • <bdo id='QKzzu'></bdo><ul id='QKzzu'></ul>