From 1d86931f9deb7028f19b8a5ccf7ada79acd9ae9b Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Tue, 8 Feb 2022 12:09:00 +0000 Subject: [PATCH] Format code with black, yapf, autopep8 and isort This commit fixes the style issues introduced in 46ef37d according to the output from black, yapf, autopep8 and isort. Details: https://deepsource.io/gh/The-4th-Hokage/yondaime-hokage/transform/f50aae91-ff34-4305-b2cc-b14786a81b85/ --- minato_namikaze/lib/util/context.py | 20 +++++++++++++------- minato_namikaze/slash/activities.py | 3 +-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/minato_namikaze/lib/util/context.py b/minato_namikaze/lib/util/context.py index 7aa5f7bf..6548645b 100644 --- a/minato_namikaze/lib/util/context.py +++ b/minato_namikaze/lib/util/context.py @@ -14,7 +14,8 @@ class ConfirmationView(discord.ui.View): - def __init__(self, *, timeout: float, author_id: int, ctx: Context, delete_after: bool) -> None: + def __init__(self, *, timeout: float, author_id: int, ctx: Context, + delete_after: bool) -> None: super().__init__(timeout=timeout) self.value: Optional[bool] = None self.delete_after: bool = delete_after @@ -22,33 +23,38 @@ def __init__(self, *, timeout: float, author_id: int, ctx: Context, delete_after self.ctx: Context = ctx self.message: Optional[discord.Message] = None - async def interaction_check(self, interaction: discord.Interaction) -> bool: + async def interaction_check(self, + interaction: discord.Interaction) -> bool: if interaction.user and interaction.user.id == self.author_id: return True else: - await interaction.response.send_message('This confirmation dialog is not for you.', ephemeral=True) + await interaction.response.send_message( + "This confirmation dialog is not for you.", ephemeral=True) return False async def on_timeout(self) -> None: if self.delete_after and self.message: await self.message.delete() - @discord.ui.button(label='Confirm', style=discord.ButtonStyle.green) - async def confirm(self, button: discord.ui.Button, interaction: discord.Interaction): + @discord.ui.button(label="Confirm", style=discord.ButtonStyle.green) + async def confirm(self, button: discord.ui.Button, + interaction: discord.Interaction): self.value = True await interaction.response.defer() if self.delete_after: await interaction.delete_original_message() self.stop() - @discord.ui.button(label='Cancel', style=discord.ButtonStyle.red) - async def cancel(self, button: discord.ui.Button, interaction: discord.Interaction): + @discord.ui.button(label="Cancel", style=discord.ButtonStyle.red) + async def cancel(self, button: discord.ui.Button, + interaction: discord.Interaction): self.value = False await interaction.response.defer() if self.delete_after: await interaction.delete_original_message() self.stop() + class Context(commands.Context): async def entry_to_code(self, entries): width = max(len(a) for a, b in entries) diff --git a/minato_namikaze/slash/activities.py b/minato_namikaze/slash/activities.py index e24207b6..56d94c65 100644 --- a/minato_namikaze/slash/activities.py +++ b/minato_namikaze/slash/activities.py @@ -18,8 +18,7 @@ class Activities( - discord.SlashCommand, -): + discord.SlashCommand, ): """Get access to discord beta activities feature""" activities: typing.Optional[typing.Literal[