Answers for "discord.py make command admin only"

2

discord.py make command admin only

# 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 let only admins do a command in discord.py

@commands.has_permissions(administrator=True)
@client.command() 
async def admins_only_command(ctx, *, args):
    # ur code
Posted by: Guest on June-06-2020

Code answers related to "discord.py make command admin only"

Python Answers by Framework

Browse Popular Code Answers by Language