Skip to content
Sign upLog in
← Back to Community
how can i send cooldown in this format Hours:Minutes:seconds
Profile icon
chinnupavan48

I tried this ..

async def on_command_error(ctx,error): if isinstance(error,commands.CommandOnCooldown): s=error.retry_after mes=('Try again in {}s'.format(int(s))) await ctx.send(mes)
Voters
Profile icon
chinnupavan48
Comments
hotnewtop
Profile icon
MrVoo

Make your own function for it, like this.

from time import sleep def sleep2(h,m,s): duration = s+ m*60+ h*3600 sleep(duration)
Profile icon
chinnupavan48

@MrVoo

Thank you...
i tried this and it's working fine

async def on_command_error(ctx,error): if isinstance(error,commands.CommandOnCooldown): secs=error.retry_after mes=f"{secs // 3600:02.0f}:{(secs // 60) % 60:02.0f}:{secs % 60:02.0f}" await ctx.send("```please try again in : ```" + mes)