Answers for "how to get the guild permissions for discord py"

3

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
-1

discord.py permissions

@bot.command()
@commands.has_permissions(manage_messages=True)
async def test(ctx):
    await ctx.send('You can manage messages.')
   
# https://discordpy.readthedocs.io/en/stable/api.html#discord.Permissions
Posted by: Guest on November-15-2021

Code answers related to "how to get the guild permissions for discord py"

Python Answers by Framework

Browse Popular Code Answers by Language