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

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

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

      1. <tfoot id='iiKQp'></tfoot>

        如何让我的命令只禁止一个公会中的用户

        时间:2023-10-10
          <tbody id='3oZLj'></tbody>

            <bdo id='3oZLj'></bdo><ul id='3oZLj'></ul>
            <tfoot id='3oZLj'></tfoot>

            <small id='3oZLj'></small><noframes id='3oZLj'>

            • <legend id='3oZLj'><style id='3oZLj'><dir id='3oZLj'><q id='3oZLj'></q></dir></style></legend>
              • <i id='3oZLj'><tr id='3oZLj'><dt id='3oZLj'><q id='3oZLj'><span id='3oZLj'><b id='3oZLj'><form id='3oZLj'><ins id='3oZLj'></ins><ul id='3oZLj'></ul><sub id='3oZLj'></sub></form><legend id='3oZLj'></legend><bdo id='3oZLj'><pre id='3oZLj'><center id='3oZLj'></center></pre></bdo></b><th id='3oZLj'></th></span></q></dt></tr></i><div id='3oZLj'><tfoot id='3oZLj'></tfoot><dl id='3oZLj'><fieldset id='3oZLj'></fieldset></dl></div>
                1. 本文介绍了如何让我的命令只禁止一个公会中的用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                    @commands.command(aliases=['hban'])
                    @commands.has_permissions(manage_messages=True)
                    @commands.cooldown(1,5,BucketType.user)
                    async def hackban(self, ctx, usid:int):
                        for guild in ctx.bot.guilds:
                            await guild.ban(discord.Object(id=usid))
                            embed = discord.Embed(title="<:Checkmark:837279790682734593>  "+f"Successfully hack banned {usid}", color=discord.Color.dark_purple())
                            await ctx.send(embed=embed)
                  

                  这个命令在它所在的所有公会中禁止用户,我如何使它只禁止我使用该命令的公会中的用户?

                  This command bans the user in all guilds it is in, how do I make it only ban the user in the guild I used the command in?

                  推荐答案

                  只需去掉for循环,使用ctx.guild作为公会

                  Simply remove the for-loop and use ctx.guild as the guild

                  @commands.command(aliases=['hban'])
                  @commands.has_permissions(manage_messages=True)
                  @commands.cooldown(1,5,BucketType.user)
                  async def hackban(self, ctx, usid:int):
                     await ctx.guild.ban(discord.Object(id=usid))   
                     embed = discord.Embed(title="<:Checkmark:837279790682734593>  "+f"Successfully hack banned {usid}", color=discord.Color.dark_purple())
                     await ctx.send(embed=embed)
                  

                  这篇关于如何让我的命令只禁止一个公会中的用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:获取触发 on_raw_reaction_remove(payload) 的用户 下一篇:是否可以将某个语音频道中的用户静音,而不是

                  相关文章

                  最新文章

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

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

                      <legend id='uNuC1'><style id='uNuC1'><dir id='uNuC1'><q id='uNuC1'></q></dir></style></legend>
                      • <bdo id='uNuC1'></bdo><ul id='uNuC1'></ul>