I'm currently making a command which has a cooldown of 5 days, and I'm currently using this code for the cooldown.
def better_time(self, cd:int):time = f"{cd}s"if cd > 60:minutes = cd - (cd % 60)seconds = cd - minutesminutes = int(minutes/ 60)time = f"{minutes} minutes {seconds} seconds"if minutes > 60:hoursglad = minutes -(minutes % 60)hours = int(hoursglad/ 60)minutes = minutes - (hours*60)time = f"{hours} hours {minutes} minutes {seconds} seconds"return time
How would I do days? I have tried the following (it has confused me):
def better_time(self, cd:int):time = f"{cd} seconds"if cd > 60:minutes = cd - (cd % 60)seconds = cd - minutesminutes = int(minutes/ 60)time = f"{minutes} minutes {seconds} second(s)"if minutes > 60:hoursglad = minutes -(minutes % 60)hours = int(hoursglad/ 60)minutes = minutes - (hours*60)time = f"{hours} hours {minutes} minute(s) {seconds} second(s)"if hours > 86400:daysglad = minutes -(hours % 60)days = int(daysglad/ 60)minutes = minutes - (days*60)time = f"{days} days {minutes} minute(s) {seconds} second(s)"return time```Yes, I know it's wrong, it has confused me.