1

hello i added a few minutes cool-down for commands its working fine. but for some commands i added few hours cool-down but it showing 900 minutes and 30 seconds. so how to make below code to show hours, minutes and seconds.

elif isinstance(error, commands.CommandOnCooldown):
    m, s = divmod(error.retry_after, 60)
    fmt = "Try again in {} minutes and {} seconds" \
        .format(round(m), round(s))
    try:
        await bot.send_message(ctx.message.channel, fmt)
    except discord.Forbidden:
        pass
Demotry
  • 869
  • 4
  • 21
  • 40
  • Possible duplicate of [Python format timedelta to string](https://stackoverflow.com/questions/538666/python-format-timedelta-to-string) – Tomalak Sep 21 '18 at 06:20
  • 2
    Possible duplicate of [Python function to convert seconds into minutes, hours, and days](https://stackoverflow.com/questions/4048651/python-function-to-convert-seconds-into-minutes-hours-and-days) – zwer Sep 21 '18 at 06:39
  • `h, m = divmod(m, 60)` after your current `divmod` line. – Patrick Haugh Sep 21 '18 at 12:29
  • @PatrickHaugh thanks. anyway i added same after researching. – Demotry Sep 21 '18 at 12:30

0 Answers0