diff options
| author | 2019-01-16 13:18:00 +0100 | |
|---|---|---|
| committer | 2019-01-16 13:18:00 +0100 | |
| commit | efce6be44154920a79f580e5e0c2f4721d0d0944 (patch) | |
| tree | a40ad317c2a44e75d1f1842a505615b90a2a4d61 | |
| parent | Updating docstring for 'bigbrother nominate' command so it's equal to 'nominate' (diff) | |
Changing incorrect type hinting for _parse_infraction_time and updating its docstring
| -rw-r--r-- | bot/cogs/bigbrother.py | 8 | 
1 files changed, 6 insertions, 2 deletions
| diff --git a/bot/cogs/bigbrother.py b/bot/cogs/bigbrother.py index b68785161..f07289985 100644 --- a/bot/cogs/bigbrother.py +++ b/bot/cogs/bigbrother.py @@ -113,8 +113,12 @@ class BigBrother:          return WatchInformation(reason="(no reason specified)", actor_id=None, inserted_at=None)      @staticmethod -    def _parse_infraction_time(infraction: str) -> struct_time: -        """Takes RFC1123 date_time string and returns time object for sorting purposes""" +    def _parse_infraction_time(infraction: dict) -> struct_time: +        """ +        Helper function that retrieves the insertion time from the infraction dictionary, +        converts the retrieved RFC1123 date_time string to a time object, and returns it +        so infractions can be sorted by their insertion time. +        """          date_string = infraction["inserted_at"]          return strptime(date_string, "%a, %d %b %Y %H:%M:%S %Z") | 
