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

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

        <bdo id='m9eZL'></bdo><ul id='m9eZL'></ul>

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

        在消息删除消息 Discord.py

        时间:2023-10-10
        <legend id='StxxX'><style id='StxxX'><dir id='StxxX'><q id='StxxX'></q></dir></style></legend>
            <bdo id='StxxX'></bdo><ul id='StxxX'></ul>

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

                <tfoot id='StxxX'></tfoot>

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

                  本文介绍了在消息删除消息 Discord.py的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  import discord
                  import asyncio
                  client = discord.Client()
                  
                  @client.event
                  async def on_ready():
                      print ("I’m Now Online")
                  
                  @client.event
                  async def on_message(message):
                    if message.author == client.user:
                      return
                    elif message.content.startswith("deletethis"):
                  

                  我想知道当消息的作者发送上面的命令时,我怎么能添加到这个来删除上面的命令.有人可以帮助创建一个吗?我已经尝试了自己的大脑并没有在网上找到任何东西,所以我正在寻求一些帮助.

                  I’m wonder how I could be able to add to this to delete the above command when the author of the message sends the command above. May someone help create one? I’ve tried my self by brain and didn’t find anything online so I’m looking for some help maybe.

                  推荐答案

                  for 异步只做

                  await client.delete_message(message)
                  

                  否则 重写就可以了p>

                  otherwise for rewrite just do

                  await message.delete()
                  

                  完成的代码:

                  @client.event
                  async def on_message(message):
                    if message.author == client.user:
                      return
                  
                    if message.content.startswith("deletethis"):
                        await asyncio.sleep(1)
                        await message.delete()
                  

                  这篇关于在消息删除消息 Discord.py的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使 discord.py 机器人私人/直接消息不是作者的 下一篇:播放音频时,最后一部分被切断.如何解决这个问

                  相关文章

                  最新文章

                • <legend id='uj5pl'><style id='uj5pl'><dir id='uj5pl'><q id='uj5pl'></q></dir></style></legend>

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

                    <tfoot id='uj5pl'></tfoot>
                  1. <small id='uj5pl'></small><noframes id='uj5pl'>

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