From 752a41855ae4203c7f118061de38736fce22e005 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 3 May 2024 20:21:30 -0400 Subject: [PATCH] fix(aurora): actually fixed the string concatenation bug --- aurora/aurora.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/aurora/aurora.py b/aurora/aurora.py index 532fea8..25c5cd4 100644 --- a/aurora/aurora.py +++ b/aurora/aurora.py @@ -18,7 +18,8 @@ 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, humanize_timedelta, 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 @@ -27,10 +28,18 @@ from aurora.menus.guild import Guild from aurora.menus.immune import Immune from aurora.menus.overrides import Overrides from aurora.utilities.config import config, register_config -from aurora.utilities.database import connect, create_guild_table, fetch_case, 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.database import (connect, create_guild_table, fetch_case, + 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.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): @@ -386,10 +395,10 @@ class Aurora(commands.Cog): await target.add_roles( role, - reason=f"Role added by {interaction.user.id}{' for ' + {humanize_timedelta(timedelta=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_timedelta(timedelta=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( @@ -403,7 +412,7 @@ class Aurora(commands.Cog): reason, ) await response.edit( - 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}`", + 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) @@ -492,10 +501,10 @@ class Aurora(commands.Cog): await target.add_roles( role, - reason=f"Role removed by {interaction.user.id}{' for ' + {humanize_timedelta(timedelta=parsed_time)} if parsed_time != 'NULL' else ''} for: {reason}", + reason=f"Role removed 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 had the {role.mention} role removed{' for ' + {humanize_timedelta(timedelta=parsed_time)} if parsed_time != 'NULL' else ''}!\n**Reason** - `{reason}`" + content=f"{target.mention} has had the {role.mention} role removed{' for ' + humanize_timedelta(timedelta=parsed_time) if parsed_time != 'NULL' else ''}!\n**Reason** - `{reason}`" ) moderation_id = await mysql_log( @@ -509,7 +518,7 @@ class Aurora(commands.Cog): reason, ) await response.edit( - content=f"{target.mention} has had the {role.mention} role removed{' for ' + {humanize_timedelta(timedelta=parsed_time)} if parsed_time != 'NULL' else ''}! (Case `#{moderation_id:,}`)\n**Reason** - `{reason}`", + content=f"{target.mention} has had the {role.mention} role removed{' for ' + humanize_timedelta(timedelta=parsed_time) if parsed_time != 'NULL' else ''}! (Case `#{moderation_id:,}`)\n**Reason** - `{reason}`", ) await log(interaction, moderation_id)