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

    • <bdo id='5BCQ1'></bdo><ul id='5BCQ1'></ul>

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

      <small id='5BCQ1'></small><noframes id='5BCQ1'>

      <tfoot id='5BCQ1'></tfoot>

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

        如何響應(yīng) discord.py 中的錯(cuò)誤用戶命令

        How to respond to wrong user command in discord.py(如何響應(yīng) discord.py 中的錯(cuò)誤用戶命令)

          1. <tfoot id='DPeXK'></tfoot>
              <tbody id='DPeXK'></tbody>

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

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

                  本文介紹了如何響應(yīng) discord.py 中的錯(cuò)誤用戶命令的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  如果用戶鍵入 /foo 并且該命令不存在,我如何發(fā)送消息說該命令不存在"?

                  If user types /foo and that command does not exist, how do I send the message saying "This command does not exist"?

                  這可能很簡(jiǎn)單,但我有點(diǎn)困惑.

                  This is maybe pretty simple but I'm bit confused.

                  如果您需要更多信息,請(qǐng)發(fā)表評(píng)論.

                  If you need more info please comment.

                  謝謝!

                  推薦答案

                  你可以定義一個(gè) on_command_error 事件(請(qǐng)注意,與記錄的重寫分支相比,異步分支上的參數(shù)順序相反)如果出現(xiàn) CommandError ,將被調(diào)用.

                  You can define an on_command_error event (Note that the order of arguments is reversed on the async branch, compared to the documented rewrite branch) that will be called if there if a CommandError is raised.

                  然后您可以簽入 錯(cuò)誤處理程序 如果錯(cuò)誤是 CommandNotFound 錯(cuò)誤并相應(yīng)處理:

                  You can then check in that error handler if the error is a CommandNotFound error and handle it accordingly:

                  @bot.event
                  async def on_command_error(error, ctx):
                      if isinstance(error, commands.CommandNotFound):
                          await bot.send_message(ctx.message.channel, "No such command")
                      else:
                          raise error
                  

                  這假設(shè)您正在使用 discord.ext.commands 擴(kuò)展來編寫命令(您應(yīng)該這樣做).

                  This assumes you are using the discord.ext.commands extension to write your commands (which you should).

                  這篇關(guān)于如何響應(yīng) discord.py 中的錯(cuò)誤用戶命令的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

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

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

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

                          <tfoot id='DKGwM'></tfoot>

                          • 主站蜘蛛池模板: 精品自拍视频在线观看 | 日韩中文字幕 | 91精品一区 | 久操国产 | 欧美三级视频 | 国产一区二区精品在线观看 | 在线视频一区二区 | 欧美激情国产日韩精品一区18 | 国产欧美精品在线 | 成人福利 | 伊人色综合久久天天五月婷 | 欧美中文字幕一区 | 日韩久久久久久 | 国产麻豆乱码精品一区二区三区 | 亚洲在线| 国产日韩精品一区 | 国产欧美一区二区三区另类精品 | 成人精品一区二区三区中文字幕 | 亚洲高清视频在线 | 久久久精品黄色 | 亚洲精品一区二区二区 | 色av一区 | 天堂综合网| 韩日免费视频 | 日本不卡一区二区三区在线观看 | 国产精品国产成人国产三级 | 在线中文视频 | 久久久精品网站 | 91精品国产综合久久久久久丝袜 | 一区二区三区四区免费在线观看 | 精品久久一区 | av手机在线| 国产精品视频免费播放 | 韩日av片 | 亚洲成人免费在线 | 中文字幕在线一区 | 综合久久综合久久 | 999久久久| 国产成人免费视频网站高清观看视频 | 日本天天操 | 91精品久久久久久综合五月天 |