📌  相关文章
📜  discord py 检查用户是否有权限,如果没有则返回消息 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:58.900000             🧑  作者: Mango

代码示例1
@bot.command()
@has_permissions(kick_members=True)  
async def kick(self, ctx, Member: discord.Member):
          await bot.kick(Member)

@kick.error
async def kick_error(error, ctx):
   if isinstance(error, MissingPermissions):
       await ctx.send("You don't have permission to do that!")