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

    <tfoot id='b5y70'></tfoot>

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

        <bdo id='b5y70'></bdo><ul id='b5y70'></ul>
    2. <legend id='b5y70'><style id='b5y70'><dir id='b5y70'><q id='b5y70'></q></dir></style></legend>

        Discord.py - 如何制作特定于角色的命令?

        时间:2023-09-09
        • <bdo id='1Fb99'></bdo><ul id='1Fb99'></ul>

              <legend id='1Fb99'><style id='1Fb99'><dir id='1Fb99'><q id='1Fb99'></q></dir></style></legend>

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

            • <small id='1Fb99'></small><noframes id='1Fb99'>

                <tbody id='1Fb99'></tbody>

                  本文介绍了Discord.py - 如何制作特定于角色的命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我需要制定一个只能由具有特定角色的人执行的命令.我在 google 和 youtube 上四处搜索以找到答案,但一无所获

                  I need to make a command that can only be executed by someone that has a certain role. I searched around on google and youtube to find a answer but came up with nothing

                  推荐答案

                  您可以在命令上添加一个装饰器,以将其限制为仅具有特定角色或权限的成员.它的文档是 这里.它看起来像这样:

                  You can add a decorator on the command to restrict it to only members with specific roles or permissions. The documentation for it is here. It would look like this:

                  @bot.command()
                  @commands.has_role('RoleName')
                  async def command_name():
                  

                  请记住,您传递的 RoleName 字符串区分大小写.

                  Keep in mind that the RoleName string you pass is case sensitive.

                  这篇关于Discord.py - 如何制作特定于角色的命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使用 discord.py API 将用户移动到 discord 上的特 下一篇:Discord.py 无法获得证书

                  相关文章

                  最新文章

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

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

                    2. <tfoot id='VzAA6'></tfoot>