Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

discord py check if user has permission return message if not

@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!")
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #discord #py #check #user #permission #return #message
ADD COMMENT
Topic
Name
4+2 =