哈克班司令部 @commands.command(别名=['ckick']) @commands.has_权限(kick_members=True) @命令。冷却时间(1,3,BucketType.user) 异步def chunkkick(self、ctx、members:commands.Greedy[discord.Member]): 如果是len(成员)20: embed=discord.embed(description=”“+f“未成功,一次不能踢超过20个用户。”,color=discord.color.orange() return wait ctx.reply(嵌入=embed,提及作者=False) 如果member.id==ctx.author.id: embed=discord.embed(description=”“+f“不成功,你不能踢自己。”,color=discord.color.orange()) 等待ctx.回复(嵌入=embed,提及作者=False) 返回 如果member.top\u角色>=ctx.author.top\u角色: embed=discord.embed(description=”“+f“未成功,层次结构中的目标角色高于您的。”,color=discord.color.orange()) 等待ctx.回复(嵌入=embed,提及作者=False) 如果ctx.me.top\u角色

哈克班司令部 @commands.command(别名=['ckick']) @commands.has_权限(kick_members=True) @命令。冷却时间(1,3,BucketType.user) 异步def chunkkick(self、ctx、members:commands.Greedy[discord.Member]): 如果是len(成员)20: embed=discord.embed(description=”“+f“未成功,一次不能踢超过20个用户。”,color=discord.color.orange() return wait ctx.reply(嵌入=embed,提及作者=False) 如果member.id==ctx.author.id: embed=discord.embed(description=”“+f“不成功,你不能踢自己。”,color=discord.color.orange()) 等待ctx.回复(嵌入=embed,提及作者=False) 返回 如果member.top\u角色>=ctx.author.top\u角色: embed=discord.embed(description=”“+f“未成功,层次结构中的目标角色高于您的。”,color=discord.color.orange()) 等待ctx.回复(嵌入=embed,提及作者=False) 如果ctx.me.top\u角色,discord,discord.py,Discord,Discord.py,您必须使用成员中的循环中的成员执行所有ifs操作。另外,如果成员不是所有者,请使用elif而不是if,因为您只是在踢该成员: @commands.command(别名=['ckick']) @commands.has_权限(kick_members=True) @命令。冷却时间(1,3,BucketType.user) 异步def chunkkick(self、ctx、members:commands.Greedy[discord.Member]): 如果是len(成员)20: embed=di

您必须使用
成员中的
循环中的
成员执行所有
if
s操作。另外,如果成员不是所有者,请使用
elif
而不是
if
,因为您只是在踢该成员:

@commands.command(别名=['ckick'])
@commands.has_权限(kick_members=True)
@命令。冷却时间(1,3,BucketType.user)
异步def chunkkick(self、ctx、members:commands.Greedy[discord.Member]):
如果是len(成员)20:
embed=discord.embed(description=”“+f“未成功,一次不能踢超过20个用户。”,color=discord.color.orange()
return wait ctx.reply(嵌入=embed,提及作者=False)
其他:
embed=discord.embed(description=”“+f“您的chunkkick摘要”,color=discord.color.orange())
对于成员中的成员:#对每个成员都这样做
如果member.id==ctx.author.id:
embed.add_字段(name=member.display_name,value=”“+f“未成功,您不能踢自己。”)
返回
elif member.top\u role>=ctx.author.top\u role:
embed.add_字段(name=member.display_name,value=”“+f“未成功,层次结构中的目标角色高于您的。”)

elif ctx.me.top_角色“黑客禁令”是什么意思?这有什么用?
  @commands.command(aliases=['ckick'])
  @commands.has_permissions(kick_members=True)
  @commands.cooldown(1,3,BucketType.user)
  async def chunkkick(self, ctx, members: commands.Greedy[discord.Member]):
      if len(members) <= 1:
           embed = discord.Embed(description="<:oxmark:839069221207670804>  "+f"Unsuccessful, you can only input 2 or more users. [-ban]", color=discord.Color.orange())
           return await ctx.reply(embed=embed, mention_author=False)
      if len(members) > 20:
           embed = discord.Embed(description="<:oxmark:839069221207670804>  "+f"Unsuccessful, cannot kick more than 20 users at a time.", color=discord.Color.orange())
           return await ctx.reply(embed=embed, mention_author=False)
      if member.id == ctx.author.id:
          embed = discord.Embed(description="<:oxmark:839069221207670804>  "+f"Unsuccessful, you can't kick yourself.", color=discord.Color.orange())
          await ctx.reply(embed=embed, mention_author=False)
          return
      if member.top_role >= ctx.author.top_role:
          embed = discord.Embed(description="<:oxmark:839069221207670804>  "+f"Unsuccessful, targets role in the hierarchy is higher than yours.", color=discord.Color.orange())
          await ctx.reply(embed=embed, mention_author=False)
      if ctx.me.top_role <= member.top_role:
          embed = discord.Embed(description="<:oxmark:839069221207670804>  "+f"Unsuccessful, my role in the hierarchy lesser than targets.", color=discord.Color.orange())
          await ctx.reply(embed=embed, mention_author=False)
      if member.id == ctx.guild.owner:
          embed = discord.Embed(description="<:oxmark:839069221207670804>  "+f"Unsuccessful, owner is unkickable.", color=discord.Color.orange())
          await ctx.reply(embed=embed, mention_author=False)
          return
      else:
          join_members = ", ".join(str(member.id) for member in members)
          embed = discord.Embed(description="<:ocheckmark:839069223749812264>  "+f"**Successfully chunk kicked {join_members}**", color=discord.Color.orange())
          for member in members:
              await member.kick(reason=f"{ctx.author} | User was in a chunk kick")
          await ctx.reply(embed=embed, mention_author=False)