remove cooldown discord python 1

remove cooldown discord python

@commands.cooldown(1, 30, commands.BucketType.user)
async def test(ctx, command=None):
    if command is None:
        await ctx.send('I want this to ignore cooldown')
        # reset_cooldown is an attribute of `Command`, not `function`

    elif command.lower() == '2':
        await ctx.send('I want this to have a Cooldown')

Here is what the above code is Doing:
1. The `test` command has a cooldown of 1 use per 30 seconds.
2. If the user does not specify a command, the cooldown is reset.
3. If the user specifies the command `2`, the cooldown is not reset.

Similar Posts