fix(moderation): fixed some issues with tdc
All checks were successful
Pylint / Pylint (push) Successful in 1m11s

This commit is contained in:
Seaswimmer 2023-10-05 09:57:14 -04:00
parent 821c04732f
commit e1f2c4b8e6
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -355,13 +355,13 @@ class Moderation(commands.Cog):
await interaction.response.send_message(send, ephemeral=True)
@commands.command(aliases=["tdc"])
async def timedeltaconvert(self, ctx: commands.Context, duration: str):
"""This command converts a duration to a [`timedelta`]() Python object.
async def timedeltaconvert(self, ctx: commands.Context, *, duration: str):
"""This command converts a duration to a [`timedelta`](https://docs.python.org/3/library/datetime.html#datetime.timedelta) Python object.
## Example usage
`-timedeltaconvert 1 day 15hr 82 minutes 52`
## Output
`1 day, 16:22:53`"""
**Example usage**
`-timedeltaconvert 1 day 15hr 82 minutes 52s`
**Output**
`1 day, 16:22:52`"""
try:
parsed_time = parse(duration, as_timedelta=True, raise_exception=True)
await ctx.send(f"`{str(parsed_time)}`")