commands.cooldown
's second argument, per
takes an interval in seconds, you can easily convert your desired hours and minutes into seconds by multiplying by their equivalent in seconds (1 min = 60 sec, 1 hour = 3600 sec). You can also create a wrapper function that does the converting for you:
def cooldown(rate, per_sec=0, per_min=0, per_hour=0, type=commands.BucketType.default):
return commands.cooldown(rate, per_sec + 60 * per_min + 3600 * per_hour, type)
@bot.command(pass_context=True)
@cooldown(1, per_min=5, per_hour=1, type=commands.BucketType.user)
async def ping(ctx):
msg = "Pong {0.author.mention}".format(ctx.message)
await bot.say(msg)
This will initiate a cooldown of 1 hour and 5 minutes.