diff options
author | 2019-12-04 15:01:40 +0700 | |
---|---|---|
committer | 2019-12-04 15:01:40 +0700 | |
commit | 7e25475b78df01646cbc82176443f955bb6d1964 (patch) | |
tree | 6f95170242b5384d999098a71006ae59ecbdc132 | |
parent | Merge pull request #678 from python-discord/antimalware-paste-url (diff) |
Improved type hinting for `format_infraction_with_duration`
-rw-r--r-- | bot/utils/time.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/utils/time.py b/bot/utils/time.py index a024674ac..9520b32f8 100644 --- a/bot/utils/time.py +++ b/bot/utils/time.py @@ -113,7 +113,11 @@ def format_infraction(timestamp: str) -> str: return dateutil.parser.isoparse(timestamp).strftime(INFRACTION_FORMAT) -def format_infraction_with_duration(expiry: str, date_from: datetime.datetime = None, max_units: int = 2) -> str: +def format_infraction_with_duration( + expiry: Optional[str], + date_from: datetime.datetime = None, + max_units: int = 2 +) -> Optional[str]: """ Format an infraction timestamp to a more readable ISO 8601 format WITH the duration. |