Answers for "how to remvoe command discord.py"

0

purge command discord.py

You can treat single argument callables (like int) like converters for the purpose of declaring arguments. I also changed your permissions check to be handled automatically by a commands.check

@bot.command(pass_context=True)
@commands.has_permissions(administrator=True)
async def clean(ctx, limit: int):
        await ctx.channel.purge(limit=limit)
        await ctx.send('Cleared by {}'.format(ctx.author.mention))
        await ctx.message.delete()

@clean.error
async def clear_error(ctx, error):
    if isinstance(error, commands.MissingPermissions):
        await ctx.send("You cant do that!")
Posted by: Guest on March-20-2021
0

remove help command discord py

bot = commands.Bot(prefix,help_command=None)
Posted by: Guest on July-01-2021

Code answers related to "how to remvoe command discord.py"

Browse Popular Code Answers by Language