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

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

      1. 是一种对命令使用前缀和 ping 的方法吗?

        时间:2023-10-11
            <tbody id='uRkuO'></tbody>
          1. <small id='uRkuO'></small><noframes id='uRkuO'>

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

              <tfoot id='uRkuO'></tfoot>
                <bdo id='uRkuO'></bdo><ul id='uRkuO'></ul>

                  <i id='uRkuO'><tr id='uRkuO'><dt id='uRkuO'><q id='uRkuO'><span id='uRkuO'><b id='uRkuO'><form id='uRkuO'><ins id='uRkuO'></ins><ul id='uRkuO'></ul><sub id='uRkuO'></sub></form><legend id='uRkuO'></legend><bdo id='uRkuO'><pre id='uRkuO'><center id='uRkuO'></center></pre></bdo></b><th id='uRkuO'></th></span></q></dt></tr></i><div id='uRkuO'><tfoot id='uRkuO'></tfoot><dl id='uRkuO'><fieldset id='uRkuO'></fieldset></dl></div>
                  本文介绍了是一种对命令使用前缀和 ping 的方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我决定创建一个更有帮助的机器人,并且我想允许以两种方式激活命令:x. 是默认前缀和 @xubot,也就是 ping 机器人.

                  I've decided to create a much more helpful bot, and I would like to allow the commands to be activated in two ways: x. which is the default prefix and @xubot, aka pinging the bot.

                  我的命令是这样设置的:

                  My commands are set out like this:

                  
                  # sidenote: this is not an actual command ;)
                  
                  pref = 'x.'
                  client = Bot(command_prefix=pref)
                  
                  @client.command(name="example",
                                 pass_ctx=True)
                  async def example(ctx, type=""):
                      # the "type" parameter is used so i can check if it is "help" and display an embed
                      await ctx.send("Test!")
                  
                  
                  

                  但是,我只能激活带有前缀 x.

                  However, I can only activate the commands with my prefix, x.

                  我希望 @xubot example 以及 x.example 运行命令.有没有办法做到这一点?

                  I would like for @xubot example to run the command, as well as x.example. Is there a way to achieve this?

                  推荐答案

                  通过commands.when_提到_or 用作您的前缀:

                  Pass the commands.when_mentioned_or function as your prefix:

                  from discord.ext.commands import Bot, when_mentioned_or
                  
                  bot = Bot(command_prefix=when_mentioned_or("x."))
                  
                  ...
                  

                  这篇关于是一种对命令使用前缀和 ping 的方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:(discord.py) 有没有办法让 on_message 事件查看嵌入式 下一篇:如何提及命令的发送者?不和谐.py

                  相关文章

                  最新文章

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

                        <bdo id='hC3Qq'></bdo><ul id='hC3Qq'></ul>
                    1. <small id='hC3Qq'></small><noframes id='hC3Qq'>

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