fix(aurora): added returns to the errors in the timedelta and relativedelta commands

This commit is contained in:
Seaswimmer 2024-03-08 14:27:50 -05:00
parent 3b5932bac9
commit ddb9f30d6f
Signed by untrusted user: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -19,7 +19,8 @@ from redbot.core import app_commands, commands, data_manager
from redbot.core.app_commands import Choice from redbot.core.app_commands import Choice
from redbot.core.bot import Red from redbot.core.bot import Red
from redbot.core.commands.converter import parse_relativedelta, parse_timedelta 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,
warning)
from aurora.importers.aurora import ImportAuroraView from aurora.importers.aurora import ImportAuroraView
from aurora.importers.galacticbot import ImportGalacticBotView from aurora.importers.galacticbot import ImportGalacticBotView
@ -28,10 +29,18 @@ from aurora.menus.guild import Guild
from aurora.menus.immune import Immune from aurora.menus.immune import Immune
from aurora.menus.overrides import Overrides from aurora.menus.overrides import Overrides
from aurora.utilities.config import config, register_config from aurora.utilities.config import config, register_config
from aurora.utilities.database import connect, create_guild_table, fetch_case, mysql_log from aurora.utilities.database import (connect, create_guild_table, fetch_case,
from aurora.utilities.factory import addrole_embed, case_factory, changes_factory, evidenceformat_factory, guild_embed, immune_embed, message_factory, overrides_embed mysql_log)
from aurora.utilities.factory import (addrole_embed, case_factory,
changes_factory, evidenceformat_factory,
guild_embed, immune_embed,
message_factory, overrides_embed)
from aurora.utilities.logger import logger from aurora.utilities.logger import logger
from aurora.utilities.utils import check_moddable, check_permissions, convert_timedelta_to_str, fetch_channel_dict, fetch_user_dict, generate_dict, log, send_evidenceformat, timedelta_from_relativedelta from aurora.utilities.utils import (check_moddable, check_permissions,
convert_timedelta_to_str,
fetch_channel_dict, fetch_user_dict,
generate_dict, log, send_evidenceformat,
timedelta_from_relativedelta)
class Aurora(commands.Cog): class Aurora(commands.Cog):
@ -1695,6 +1704,7 @@ class Aurora(commands.Cog):
parsed_time = parse_timedelta(duration) parsed_time = parse_timedelta(duration)
if parsed_time is None: if parsed_time is None:
await ctx.send(error("Please provide a convertible value!")) await ctx.send(error("Please provide a convertible value!"))
return
await ctx.send(f"`{parsed_time}`") await ctx.send(f"`{parsed_time}`")
@aurora.command(aliases=["rdc", "rd", "relativedeltaconvert"]) @aurora.command(aliases=["rdc", "rd", "relativedeltaconvert"])
@ -1710,4 +1720,5 @@ class Aurora(commands.Cog):
parsed_time = parse_relativedelta(duration) parsed_time = parse_relativedelta(duration)
if parsed_time is None: if parsed_time is None:
await ctx.send(error("Please provide a convertible value!")) await ctx.send(error("Please provide a convertible value!"))
return
await ctx.send(f"`{parsed_time}`") await ctx.send(f"`{parsed_time}`")