@client.command()
@client.command.has_permissions(administrator=True)
async def kick(ctx, member: discord.Member):
await member.kick()
await ctx.message.add_reaction(" ")
await ctx.send(f"{member.name} has been kicked by {ctx.author.name}!")
await log_channel.send(f"{ctx.author.name} has kicked {member.display_name}")
我收到此错误
@client.command.has_permissions(administrator=True)
真正的未察觉意图
答案 0 :(得分:0)
不是@client.command.has_permissions()
,而是@commands.has_permissions()
,并确保您导入了from discord.ext import commands
@client.command()
@commands.has_permissions(administrator=True)
async def kick(ctx, member: discord.Member):
await member.kick()
await ctx.message.add_reaction(" ")
await ctx.send(f"{member.name} has been kicked by {ctx.author.name}!")
await ctx.log_channel.send(f"{ctx.author.name} has kicked {member.display_name}")