• <legend id='14jwr'><style id='14jwr'><dir id='14jwr'><q id='14jwr'></q></dir></style></legend>

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

        <small id='14jwr'></small><noframes id='14jwr'>

          <bdo id='14jwr'></bdo><ul id='14jwr'></ul>

      2. <tfoot id='14jwr'></tfoot>

        如何在 discord.py 中使命令不区分大小写

        时间:2023-09-11

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

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

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

                  本文介绍了如何在 discord.py 中使命令不区分大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  如何在不为不同的大写字母添加许多别名的情况下使命令不区分大小写,如下所示:

                  How would one make a command case-insensitive without adding many aliases for different capitalizations like this:

                  @bot.command(pass_context = True, name = 'test', aliases=['Test', 'tEst', 'teSt', 'tesT', 'TEst', 'TeSt', 'TesT', 'tESt', 'tEsT'])
                  async def test(self, ctx):
                      #do stuff      
                  

                  推荐答案

                  在重写分支上,commands.Bot 接受 case_insensitive参数

                  On the rewrite branch, commands.Bot accepts a case_insensitive parameter

                  bot = commands.Bot(command_prefix='!', case_insensitive=True)
                  

                  请注意,使用此功能时会有性能损失.

                  Note that there is a performance loss when using this feature.

                  这篇关于如何在 discord.py 中使命令不区分大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:SSL:CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本 下一篇:Discord 'on_member_join' 功能不起作用

                  相关文章

                  最新文章

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

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

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