From b6c73375ae10f19a5a863166878c776b1dabc6d3 Mon Sep 17 00:00:00 2001 From: Mega-JC <65417594+Mega-JC@users.noreply.github.com> Date: Tue, 2 Jul 2024 14:53:54 +0200 Subject: [PATCH] Run black --- pcbot/exts/bot_management.py | 6 +++--- pcbot/exts/helpforums_pre/cogs.py | 9 ++++++--- pcbot/exts/helpforums_pre/constants.py | 2 +- pcbot/exts/showcase.py | 2 +- pcbot/utils/__init__.py | 4 +++- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pcbot/exts/bot_management.py b/pcbot/exts/bot_management.py index 183283c..a851415 100644 --- a/pcbot/exts/bot_management.py +++ b/pcbot/exts/bot_management.py @@ -139,12 +139,12 @@ async def on_command(self, ctx: commands.Context[BotT]): escaped_cmd_text = discord.utils.escape_markdown(ctx.message.content) with io.StringIO(ctx.message.content) as log_buffer: - log_txt_file = discord.File(log_buffer, filename="command.txt") # type: ignore - + log_txt_file = discord.File(log_buffer, filename="command.txt") # type: ignore + invocation_embed_dict = dict( author=dict( name=f"{ctx.author}", - icon_url= f"{ctx.author.avatar or ctx.author.default_avatar}", + icon_url=f"{ctx.author.avatar or ctx.author.default_avatar}", ), description=escaped_cmd_text if len(escaped_cmd_text) <= 4095 diff --git a/pcbot/exts/helpforums_pre/cogs.py b/pcbot/exts/helpforums_pre/cogs.py index 1d20b5b..dc24bfa 100644 --- a/pcbot/exts/helpforums_pre/cogs.py +++ b/pcbot/exts/helpforums_pre/cogs.py @@ -411,7 +411,6 @@ async def on_message_edit(self, before: discord.Message, after: discord.Message) elif ( not caution_types ) and bad_help_thread_data_exists: # delete caution messages - bad_thread_data = await self.fetch_bad_help_thread_data(thread.id) for msg_id in bad_thread_data["caution_message_ids"]: @@ -899,7 +898,9 @@ async def on_raw_reaction_add(self, payload: discord.RawReactionActionEvent): + ( "the OP" if by_op - else "an admin" if by_admin else "a Helpfulie" + else "an admin" + if by_admin + else "a Helpfulie" ) + " (via adding a ✅ reaction).", applied_tags=new_tags, @@ -987,7 +988,9 @@ async def on_raw_reaction_remove(self, payload: discord.RawReactionActionEvent): + ( "the OP" if by_op - else "an admin" if by_admin else "a Helpfulie" + else "an admin" + if by_admin + else "a Helpfulie" ) + " (via removing a ✅ reaction).", ) diff --git a/pcbot/exts/helpforums_pre/constants.py b/pcbot/exts/helpforums_pre/constants.py index 38f83ef..0de226f 100644 --- a/pcbot/exts/helpforums_pre/constants.py +++ b/pcbot/exts/helpforums_pre/constants.py @@ -27,7 +27,7 @@ INVALID_HELP_THREAD_TYPES = { "thread_title_too_short", "member_asking_for_help", - #"member_exclaiming_about_not_working_code", + # "member_exclaiming_about_not_working_code", "member_asking_for_code", "member_asking_about_problem_with_code", "wrong_thread_help_topic_pygame", diff --git a/pcbot/exts/showcase.py b/pcbot/exts/showcase.py index 9a32f8b..52afbd4 100644 --- a/pcbot/exts/showcase.py +++ b/pcbot/exts/showcase.py @@ -284,7 +284,7 @@ async def thread_triple(thread: discord.Thread): + ( f"{rank_emoji}: {thread_reactions_count}" if rank_emoji - else f"{thread_reactions_count}: Unique | " + else f"{thread_reactions_count}: Unique | " + ", ".join( f"{reaction.emoji}: {reaction.count}" for reaction in starter_message.reactions diff --git a/pcbot/utils/__init__.py b/pcbot/utils/__init__.py index 0eb5ef8..ce98e6b 100644 --- a/pcbot/utils/__init__.py +++ b/pcbot/utils/__init__.py @@ -499,7 +499,9 @@ async def initialize_pgcbots_db_schema(db: DatabaseDict, config: dict[str, Any]) + ( "initial " if is_initial_migration - else "automatic " if config.get("auto_migrate") else "" + else "automatic " + if config.get("auto_migrate") + else "" ) + "bot database migration..." )