@client.command()
@commands.has_permissions(administrator=True)
async def kick(ctx, member : discord.Member, *, reason=None):
try:
await member.kick(reason=reason)
embed = discord.Embed(colour=maincolour)
embed.title = f"**Member {member.mention} Kicked."
embed.description = f"**Reason** » {reason}.\n**Status** » Successful!"
await ctx.send(embed=embed)
except:
embed = discord.Embed(colour=maincolour)
embed.title = "**Kick not successful."
embed.description = "**Possible Errors:**\n» Insufficient Permissions (Requires Administrator)\n» Error with Bot."
await ctx.send(embed=embed)
在线上
@commands.has_permissions(administrator=True)
错误是'Command' object has no attribute 'has_permissions'。
我该如何修复这个错误?这段代码适用于我的朋友。
婷婷同学_
相关分类