退出公会:discord.py禁止用户退出公会

当我尝试使用命令时,它说“用户是必需的参数”

@commands.command(aliases=['hban'])
@commands.has_permissions(ban_members=True)
@commands.cooldown(1, 3, BucketType.user)
async def hackban(self, ctx, user: discord.User):
    if user in ctx.guild.members:
        embed = discord.Embed(description=":oxmark:  "+f"Unsuccessful, the user is in this guild. [-help ban]", color=discord.Color.orange())
        await ctx.reply(embed=embed, mention_author=False)
    else:
        await ctx.guild.ban(user)
        embed = discord.Embed(title=":ocheckmark:  "+f"Successfully hack banned {user.name}", color=discord.Color.orange())
        await ctx.reply(embed=embed, mention_author=False)
-1
@client.command()
@check(check_if_user_has_premium)
@commands.has_permissions(ban_members=True)
async def hackban(ctx, user: discord.User = None):
    guild = ctx.guild
    if user == None:
        await ctx.send("Please enter a member to ban") 
        return()
    else:
        await guild.ban(user)
        embed = discord.Embed(title=":ocheckmark:  "+f"Successfully hack banned {user.name}", color=discord.Color.orange())
        await ctx.reply(embed=embed, mention_author=False)

工程

本站系公益性非盈利分享网址,本文来自用户投稿,不代表边看边学立场,如若转载,请注明出处

(692)
Processing互动代码:解开-Coldwood互动
上一篇
客户端文件与服务器不匹配:TCP服务器客户端或客户端服务器
下一篇

相关推荐

发表评论

登录 后才能评论

评论列表(50条)