久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

    • <bdo id='X3o4p'></bdo><ul id='X3o4p'></ul>

    1. <tfoot id='X3o4p'></tfoot>

      1. <legend id='X3o4p'><style id='X3o4p'><dir id='X3o4p'><q id='X3o4p'></q></dir></style></legend>

        如何使用 discord.py 按 ID 刪除特定消息

        How to delete a specific message by ID using discord.py(如何使用 discord.py 按 ID 刪除特定消息)

        1. <legend id='At0Z5'><style id='At0Z5'><dir id='At0Z5'><q id='At0Z5'></q></dir></style></legend>

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

                1. <small id='At0Z5'></small><noframes id='At0Z5'>

                2. 本文介紹了如何使用 discord.py 按 ID 刪除特定消息的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試使用它的 ID 刪除一條消息.我正在使用 discord.py.

                  I am trying to delete a message using it's ID. I am using discord.py.

                  邏輯流程

                  用戶發送命令.示例:!message hi
                  Bot 使用用戶的消息 ID 刪除!message hi"
                  機器人說嗨"

                  User sends command. example: !message hi
                  Bot deletes "!message hi" using User's message ID
                  Bot says "hi"

                  我已經知道如何讓它復制我的消息,但我很難讓它刪除它們.我不想說它會在消息成為之前刪除消息,否則在繁忙的服務器上它可能無法正常工作.我想獲取命令消息的 ID,然后使用它的 ID 將其刪除.

                  I have figured out how to get it to copy my messages, but I am having difficulty getting it to delete them. I didn't want to say that it deletes the message before it's one otherwise on busy servers it might not work. I wanted to get the command message's ID then delete it using it's ID.

                  推薦答案


                  更新為 discord.py v1.2+

                  您應該使用 TextChannel.fetch_message 函數.

                  msg = await channel.fetch_message(message_id)
                  await msg.delete()
                  


                  原始答案(不再有效):

                  要回答這個問題:要按 ID 刪除消息,您必須獲取消息對象(首選)或通過 client.http(非首選)

                  您可以使用 Client.get_message 函數

                  You can use the Client.get_message function

                  msg = await client.get_message(channel, message_id)
                  

                  或者,您的特定用例似乎只是刪除已發送的消息,因此您可以只使用 on_message(msg)
                  提供的消息收到消息后,您可以:

                  Alternately, your specific use case seems to just be deleting the message that was sent, so you could just use the message supplied by on_message(msg)
                  After you have the message, you can do:

                  await client.delete_message(msg)
                  


                  第二個選項:使用client.http

                  假設你知道頻道的 ID,你可以簡單地調用


                  Second option: Using client.http

                  Assuming you know the channel's ID, you can simply call

                  await client.http.delete_message(channel_id, message_id)
                  

                  這種方法雖然對刪除任意位置的任意消息很有用,但如果獲取消息是可行的選擇,則不應使用此方法.

                  This method while useful for deleting arbitrary messages in arbitrary places shouldn't be used if getting the message is feasably an option.

                  這篇關于如何使用 discord.py 按 ID 刪除特定消息的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)
                      <tbody id='Lu2ow'></tbody>

                    • <i id='Lu2ow'><tr id='Lu2ow'><dt id='Lu2ow'><q id='Lu2ow'><span id='Lu2ow'><b id='Lu2ow'><form id='Lu2ow'><ins id='Lu2ow'></ins><ul id='Lu2ow'></ul><sub id='Lu2ow'></sub></form><legend id='Lu2ow'></legend><bdo id='Lu2ow'><pre id='Lu2ow'><center id='Lu2ow'></center></pre></bdo></b><th id='Lu2ow'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Lu2ow'><tfoot id='Lu2ow'></tfoot><dl id='Lu2ow'><fieldset id='Lu2ow'></fieldset></dl></div>
                    • <legend id='Lu2ow'><style id='Lu2ow'><dir id='Lu2ow'><q id='Lu2ow'></q></dir></style></legend>

                          • <bdo id='Lu2ow'></bdo><ul id='Lu2ow'></ul>

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

                            <tfoot id='Lu2ow'></tfoot>
                            主站蜘蛛池模板: 超碰日本| 免费一级大片 | 在线视频一区二区三区 | 欧美日韩国产在线观看 | 高清国产一区二区 | 欧美三级视频在线观看 | 麻豆精品一区二区三区在线观看 | 国产二区av | 日韩一区二区三区在线观看 | 国产婷婷色综合av蜜臀av | 欧美日韩在线高清 | 性色综合 | 男女视频免费 | 久久久久九九九女人毛片 | 成人在线视频一区 | 99久久国产综合精品麻豆 | 久久久精| 美国av毛片| 综合色播| 欧美日韩1区| av在线免费不卡 | 国产成在线观看免费视频 | av毛片在线免费观看 | 亚洲视频精品在线 | 久久亚洲国产精品日日av夜夜 | 91黄在线观看 | 亚洲色图第一页 | 美女日批免费视频 | 亚洲午夜av久久乱码 | 精品精品视频 | 涩涩视频在线观看 | 久久丝袜视频 | gogo肉体亚洲高清在线视 | 日韩成人免费av | 玖玖综合在线 | 欧美精品video| 国产精品毛片一区二区在线看 | a免费视频 | 国产免费一区二区 | 2023亚洲天堂| 亚洲精品一区国产精品 |