diff options
author | 2021-08-05 17:19:24 -0700 | |
---|---|---|
committer | 2021-08-05 17:19:24 -0700 | |
commit | 6ceb2c09114233f6db00e11ea85891adcdcf7f4f (patch) | |
tree | 93a5e7dbba71c5363c3084e7a804e77b8016d65d | |
parent | Time: remove absolute param from format_infraction_with_duration (diff) |
Time: remove broken enum type check in discord_timestamp
First, the `args` attribute doesn't exist on enums. Even if it did, this
check only works if the argument given is an enum member (of any enum).
Such occurrence seems too rare to warrant an explicit check.
-rw-r--r-- | bot/utils/time.py | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/bot/utils/time.py b/bot/utils/time.py index 190adf885..ddcf5bac2 100644 --- a/bot/utils/time.py +++ b/bot/utils/time.py @@ -62,9 +62,6 @@ def _stringify_time_unit(value: int, unit: str) -> str: def discord_timestamp(timestamp: ValidTimestamp, format: TimestampFormats = TimestampFormats.DATE_TIME) -> str: """Create and format a Discord flavored markdown timestamp.""" - if format not in TimestampFormats: - raise ValueError(f"Format can only be one of {', '.join(TimestampFormats.args)}, not {format}.") - # Convert each possible timestamp class to an integer. if isinstance(timestamp, datetime.datetime): timestamp = (timestamp - arrow.get(0)).total_seconds() |