Skip to content
This repository was archived by the owner on Oct 2, 2023. It is now read-only.

Commit 93a219d

Browse files
committed
Improved docstrings for both functions
1 parent 29e89d1 commit 93a219d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

PyDrocsid/converter.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ class DurationConverter(Converter[int | None]):
6969
"""
7070

7171
async def convert(self, ctx: Context[Bot], argument: str) -> int | None:
72+
"""
73+
Extracts information about years, months, weeks, days, hours and minutes from a string
74+
and returns the total amount of time in minutes
75+
:param ctx: the context the converter was called in
76+
:param argument: the string with the different time units or a variation of 'inf' for an infinite time span
77+
:returns: the total amount of time in minutes as an int or None if the time span is infinite
78+
"""
7279
if argument.lower() in ("inf", "perm", "permanent", "-1", "∞"):
7380
return None
7481
if (match := re.match(r"^(\d+y)?(\d+m)?(\d+w)?(\d+d)?(\d+H)?(\d+M)?$", argument)) is None:

PyDrocsid/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def check_message_send_permissions(
238238

239239
def time_to_units(minutes: int | float) -> str:
240240
"""
241-
Util function to split minutes back into different time units
241+
Util function to split a time span given in minutes into the different units years, months, days, hours and minutes
242242
"""
243243
_keys = ("years", "months", "days", "hours", "minutes")
244244

0 commit comments

Comments
 (0)