diff --git a/changelog.d/3231.bugfix.1.rst b/changelog.d/3231.bugfix.1.rst new file mode 100644 index 000000000..1e996a66b --- /dev/null +++ b/changelog.d/3231.bugfix.1.rst @@ -0,0 +1 @@ +Fix an attribute error that can be raised in humanize_timedelta if seconds = 0. \ No newline at end of file diff --git a/redbot/core/utils/chat_formatting.py b/redbot/core/utils/chat_formatting.py index a5ea031a3..6c4c8d203 100644 --- a/redbot/core/utils/chat_formatting.py +++ b/redbot/core/utils/chat_formatting.py @@ -430,7 +430,7 @@ def humanize_timedelta( """ try: - obj = seconds or timedelta.total_seconds() + obj = seconds if seconds is not None else timedelta.total_seconds() except AttributeError: raise ValueError("You must provide either a timedelta or a number of seconds")