Answers for "how to limit commands to a person in discord.py"

2

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
Posted by: Guest on September-29-2020
0

how to limit a command to a role in discord.py

@bot.command()
@commands.has_role('RoleName')
async def command_name():
Posted by: Guest on June-24-2020

Code answers related to "how to limit commands to a person in discord.py"

Python Answers by Framework

Browse Popular Code Answers by Language