Skip to content Skip to sidebar Skip to footer

Discord.py Bot Getting Cooldown Time Remaining Of Command

I'm working on a python based discord bot that has the following command @client.command(name='Mine', description='Mine daily.', brief='Mine daily.',

Solution 1:

You'll need to write an error handler for your command that handles the CommandOnCooldown error and sends the message.

@mine.error
async def mine_error(ctx, error):
    if isinstance(error, commands.CommandOnCooldown):
        msg = 'This command is ratelimited, please try again in {:.2f}s'.format(error.retry_after)
        await ctx.send(msg)
    else:
        raise error

Post a Comment for "Discord.py Bot Getting Cooldown Time Remaining Of Command"