Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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
Comment

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
Comment

PREVIOUS NEXT
Code Example
Python :: python shebang line 
Python :: get a list of column names pandas 
Python :: python how to read a xlsx file 
Python :: python error get line 
Python :: numpy read image 
Python :: matplotlib x label rotation 
Python :: python hand tracking module 
Python :: python distance between coordinates 
Python :: array of random integers python 
Python :: tk table python 
Python :: python half of string 
Python :: convert mp3 to wav python 
Python :: pytest --clrear cache 
Python :: install googlesearch for python 
Python :: numpy merge arrays 
Python :: extract float from string python 
Python :: exception get line number python 
Python :: pyyaml install 
Python :: python reference script directory 
Python :: load custom font pygame 
Python :: how to install flask module in vscode 
Python :: USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F) 
Python :: tkinter load image 
Python :: show jpg in jupyter notebook 
Python :: time it in jupyter notebook 
Python :: how to apply labelencoder on multiple columns at once 
Python :: python get arguments 
Python :: get current time in python with strftime 
Python :: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. 
Python :: how to make it so the pygame window will close 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =