Horje
discord.py make command admin only Code Example
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
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




Python

Related
pytest --clrear cache Code Example pytest --clrear cache Code Example
download python on wsl Code Example download python on wsl Code Example
install python on windows subsystem for linux Code Example install python on windows subsystem for linux Code Example
get attribute in selenium python Code Example get attribute in selenium python Code Example
how to limit a command to a permission in discord.py Code Example how to limit a command to a permission in discord.py Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7