fix(aurora): remove humanize
Some checks failed
Actions / Lint Code (Ruff & Pylint) (push) Failing after 23s
Actions / Build Documentation (MkDocs) (push) Successful in 17s

This commit is contained in:
SeaswimmerTheFsh 2024-03-08 14:56:50 -05:00
parent ba7a5f9208
commit 99dddf2fa7
Signed by: cswimr
GPG key ID: B8953EC01E5C4063
4 changed files with 11 additions and 28 deletions

View file

@ -13,13 +13,12 @@ from datetime import datetime, timedelta, timezone
from math import ceil
import discord
import humanize
from discord.ext import tasks
from redbot.core import app_commands, commands, data_manager
from redbot.core.app_commands import Choice
from redbot.core.bot import Red
from redbot.core.commands.converter import parse_relativedelta, parse_timedelta
from redbot.core.utils.chat_formatting import box, error, humanize_list, warning
from redbot.core.utils.chat_formatting import box, error, humanize_list, humanize_timedelta, warning
from aurora.importers.aurora import ImportAuroraView
from aurora.importers.galacticbot import ImportGalacticBotView
@ -371,10 +370,10 @@ class Aurora(commands.Cog):
await target.add_roles(
role,
reason=f"Role added by {interaction.user.id}{(' for ' + {humanize.precisedelta(parsed_time)} if parsed_time != 'NULL' else '')} for: {reason}",
reason=f"Role added by {interaction.user.id}{(' for ' + {humanize_timedelta(timedelta=parsed_time)} if parsed_time != 'NULL' else '')} for: {reason}",
)
response: discord.WebhookMessage = await interaction.followup.send(
content=f"{target.mention} has been given the {role.mention} role{(' for ' + {humanize.precisedelta(parsed_time)} if parsed_time != 'NULL' else '')}!\n**Reason** - `{reason}`"
content=f"{target.mention} has been given the {role.mention} role{(' for ' + {humanize_timedelta(timedelta=parsed_time)} if parsed_time != 'NULL' else '')}!\n**Reason** - `{reason}`"
)
moderation_id = await mysql_log(
@ -388,7 +387,7 @@ class Aurora(commands.Cog):
reason,
)
await response.edit(
content=f"{target.mention} has been given the {role.mention} role{(' for ' + {humanize.precisedelta(parsed_time)} if parsed_time != 'NULL' else '')}! (Case `#{moderation_id:,}`)\n**Reason** - `{reason}`",
content=f"{target.mention} has been given the {role.mention} role{(' for ' + {humanize_timedelta(timedelta=parsed_time)} if parsed_time != 'NULL' else '')}! (Case `#{moderation_id:,}`)\n**Reason** - `{reason}`",
)
await log(interaction, moderation_id)
@ -445,7 +444,7 @@ class Aurora(commands.Cog):
)
await interaction.response.send_message(
content=f"{target.mention} has been muted for {humanize.precisedelta(parsed_time)}!\n**Reason** - `{reason}`"
content=f"{target.mention} has been muted for {humanize_timedelta(timedelta=parsed_time)}!\n**Reason** - `{reason}`"
)
if silent is None:
@ -476,7 +475,7 @@ class Aurora(commands.Cog):
reason,
)
await interaction.edit_original_response(
content=f"{target.mention} has been muted for {humanize.precisedelta(parsed_time)}! (Case `#{moderation_id:,}`)\n**Reason** - `{reason}`"
content=f"{target.mention} has been muted for {humanize_timedelta(timedelta=parsed_time)}! (Case `#{moderation_id:,}`)\n**Reason** - `{reason}`"
)
await log(interaction, moderation_id)
@ -686,7 +685,7 @@ class Aurora(commands.Cog):
return
await interaction.response.send_message(
content=f"{target.mention} has been banned for {humanize.precisedelta(parsed_time)}!\n**Reason** - `{reason}`"
content=f"{target.mention} has been banned for {humanize_timedelta(timedelta=parsed_time)}!\n**Reason** - `{reason}`"
)
try:
@ -720,7 +719,7 @@ class Aurora(commands.Cog):
reason,
)
await interaction.edit_original_response(
content=f"{target.mention} has been banned for {humanize.precisedelta(parsed_time)}! (Case `#{moderation_id}`)\n**Reason** - `{reason}`"
content=f"{target.mention} has been banned for {humanize_timedelta(timedelta=parsed_time)}! (Case `#{moderation_id}`)\n**Reason** - `{reason}`"
)
await log(interaction, moderation_id)
@ -1060,9 +1059,9 @@ class Aurora(commands.Cog):
}
)
duration_embed = (
f"{humanize.precisedelta(td)} | <t:{case['end_timestamp']}:R>"
f"{humanize_timedelta(timedelta=td)} | <t:{case['end_timestamp']}:R>"
if bool(case["expired"]) is False
else f"{humanize.precisedelta(td)} | Expired"
else f"{humanize_timedelta(timedelta=td)} | Expired"
)
field_value += f"\n**Duration:** {duration_embed}"