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

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

        <tfoot id='eEMKb'></tfoot>

        使用 discord.py 更改角色层次结构

        时间:2023-09-09
              <tbody id='ivGLc'></tbody>
          • <small id='ivGLc'></small><noframes id='ivGLc'>

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

                <tfoot id='ivGLc'></tfoot>

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

                • <i id='ivGLc'><tr id='ivGLc'><dt id='ivGLc'><q id='ivGLc'><span id='ivGLc'><b id='ivGLc'><form id='ivGLc'><ins id='ivGLc'></ins><ul id='ivGLc'></ul><sub id='ivGLc'></sub></form><legend id='ivGLc'></legend><bdo id='ivGLc'><pre id='ivGLc'><center id='ivGLc'></center></pre></bdo></b><th id='ivGLc'></th></span></q></dt></tr></i><div id='ivGLc'><tfoot id='ivGLc'></tfoot><dl id='ivGLc'><fieldset id='ivGLc'></fieldset></dl></div>
                  本文介绍了使用 discord.py 更改角色层次结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我想在 discord.py 中创建一个新角色.

                  I want to create a new role in discord.py.

                  但我希望这个角色位于(比方说)角色的第三个位置.我怎样才能做到这一点?

                  But I want this role to be in the (let's say) 3rd spot of the roles. How can I achieve this?

                  推荐答案

                  你会使用 Role.edit,传递一个position值,该值必须低于你最高角色的位置.

                  You would use Role.edit, passing a position value, which must be lower than the position of your highest role.

                  @bot.command()
                  async def moverole(ctx, role: discord.Role, pos: int):
                      try:
                          await role.edit(position=pos)
                          await ctx.send("Role moved.")
                      except discord.Forbidden:
                          await ctx.send("You do not have permission to do that")
                      except discord.HTTPException:
                          await ctx.send("Failed to move role")
                      except discord.InvalidArgument:
                          await ctx.send("Invalid argument")
                  

                  这篇关于使用 discord.py 更改角色层次结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在 on_member_join() discord.py 中向成员发送私人消 下一篇:如何让 discord.py 机器人 DM 特定用户

                  相关文章

                  最新文章

                  <legend id='0s8Qt'><style id='0s8Qt'><dir id='0s8Qt'><q id='0s8Qt'></q></dir></style></legend>

                  <small id='0s8Qt'></small><noframes id='0s8Qt'>

                  • <bdo id='0s8Qt'></bdo><ul id='0s8Qt'></ul>

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