make command need permissions discord.py code example
Example 1: how to limit a command to a permission in discord.py
# Make sure you don't have a command called "commands"
@client.command() # As usual
@commands.has_permissions(administrator=True) # Making sure the person executing the command has the permissions
async def foo(ctx):
await ctx.send("Hello")
#ect
Example 2: set permissions role discord.py
server = ctx.message.server
perms = discord.Permissions(send_messages=False, read_messages=True)
await client.create_role(server, name='NoSend', permissions=perms)