Answers for "how to check if command caller is owner discord.py"

1

discord.py owner only commands

# Make sure you don't have a command called "commands"
@client.command() # As usual
@commands.is_owner() # Making sure the person executing the command is the owner
async def foo(ctx):
	await ctx.send("Hello")
    #ect
Posted by: Guest on April-07-2021
-1

discord.py check if user is bot

@bot.command()
async def kick(ctx, user: discord.Member, *, reason="No reason provided"):
    if not user.bot:
        await user.kick(reason=reason)
        await ctx.send(f"Successfully kicked {user}!")
    else:
        await ctx.send("You can't kick a bot!")
Posted by: Guest on March-31-2021

Code answers related to "how to check if command caller is owner discord.py"

Python Answers by Framework

Browse Popular Code Answers by Language