diff --git a/minato_namikaze/cogs/fun/periodic_table.py b/minato_namikaze/cogs/fun/periodic_table.py index 62b9a6d1..c31dc761 100644 --- a/minato_namikaze/cogs/fun/periodic_table.py +++ b/minato_namikaze/cogs/fun/periodic_table.py @@ -91,17 +91,13 @@ def get_lattice_string(element: ELEMENTS) -> str: def get_xray_wavelength(element: ELEMENTS) -> str: try: ka = 1239.84 / ( - 13.6057 - * ((element.atomic_number - 1) ** 2) - * ((1 / 1**2) - (1 / 2**2)) + 13.6057 * ((element.atomic_number - 1) ** 2) * ((1 / 1**2) - (1 / 2**2)) ) except Exception: ka = "" try: kb = 1239.84 / ( - 13.6057 - * ((element.atomic_number - 1) ** 2) - * ((1 / 1**2) - (1 / 3**2)) + 13.6057 * ((element.atomic_number - 1) ** 2) * ((1 / 1**2) - (1 / 3**2)) ) except Exception: kb = "" diff --git a/minato_namikaze/lib/classes/barcode.py b/minato_namikaze/lib/classes/barcode.py index ad653214..d49d6ffe 100644 --- a/minato_namikaze/lib/classes/barcode.py +++ b/minato_namikaze/lib/classes/barcode.py @@ -2,6 +2,7 @@ All the code below was hacked together from https://github.com/mvictor212/pyBarcode Which is itself a port of python-barcode which is no longer available """ + from __future__ import annotations import gzip diff --git a/minato_namikaze/lib/classes/games/shinobi_match.py b/minato_namikaze/lib/classes/games/shinobi_match.py index 70e3953e..84120573 100644 --- a/minato_namikaze/lib/classes/games/shinobi_match.py +++ b/minato_namikaze/lib/classes/games/shinobi_match.py @@ -119,15 +119,19 @@ async def callback(self, interaction: discord.Interaction): await self.reduce_health(amount=random.randint(1, 5)) elif self.label.lower() == "Ninjutsu Attack".lower(): await self.reduce_health( - amount=abs(view.character1.hitpoint - view.character2.regainpoint) - if view.turn == view.player1 - else abs(view.character2.hitpoint - view.character1.regainpoint), + amount=( + abs(view.character1.hitpoint - view.character2.regainpoint) + if view.turn == view.player1 + else abs(view.character2.hitpoint - view.character1.regainpoint) + ), ) elif self.label.lower() == "Special Power Attack".lower(): await self.reduce_health( - amount=(view.character1.specialpoint / 100) * view.overall_health - if view.turn == view.player1 - else (view.character2.specialpoint / 100) * view.overall_health, + amount=( + (view.character1.specialpoint / 100) * view.overall_health + if view.turn == view.player1 + else (view.character2.specialpoint / 100) * view.overall_health + ), ) if view.turn == view.player1: view.special_moves1 -= 1 diff --git a/minato_namikaze/lib/classes/games/tictactoe.py b/minato_namikaze/lib/classes/games/tictactoe.py index cc35d3f5..0cb5caff 100644 --- a/minato_namikaze/lib/classes/games/tictactoe.py +++ b/minato_namikaze/lib/classes/games/tictactoe.py @@ -8,6 +8,7 @@ import discord + # Defines a custom button that contains the logic of the game. # The ['TicTacToe'] bit is for type hinting purposes to tell your IDE or linter # what the type of `self.view` is. It is not required. diff --git a/minato_namikaze/lib/classes/select_help.py b/minato_namikaze/lib/classes/select_help.py index 385a2f68..06876d24 100644 --- a/minato_namikaze/lib/classes/select_help.py +++ b/minato_namikaze/lib/classes/select_help.py @@ -1,6 +1,7 @@ """ This code has been fully copied from here https://github.com/Rapptz/RoboDanny/blob/rewrite/cogs/utils/paginator.py """ + from __future__ import annotations import inspect diff --git a/minato_namikaze/lib/classes/time_class.py b/minato_namikaze/lib/classes/time_class.py index e2d0314f..7f616a10 100644 --- a/minato_namikaze/lib/classes/time_class.py +++ b/minato_namikaze/lib/classes/time_class.py @@ -1,6 +1,7 @@ """ This code has been fully copied from here https://github.com/Rapptz/RoboDanny/blob/rewrite/cogs/utils/paginator.py """ + from __future__ import annotations import datetime diff --git a/minato_namikaze/lib/database/alembic/versions/c685b2a5fd53_first_init.py b/minato_namikaze/lib/database/alembic/versions/c685b2a5fd53_first_init.py index d061bccc..7e20505b 100644 --- a/minato_namikaze/lib/database/alembic/versions/c685b2a5fd53_first_init.py +++ b/minato_namikaze/lib/database/alembic/versions/c685b2a5fd53_first_init.py @@ -5,6 +5,7 @@ Create Date: 2024-03-28 08:27:01.495168 """ + from __future__ import annotations import sqlalchemy as sa diff --git a/minato_namikaze/lib/database/alembic/versions/d80905354d9d_badges.py b/minato_namikaze/lib/database/alembic/versions/d80905354d9d_badges.py index 1e160a19..af692851 100644 --- a/minato_namikaze/lib/database/alembic/versions/d80905354d9d_badges.py +++ b/minato_namikaze/lib/database/alembic/versions/d80905354d9d_badges.py @@ -5,6 +5,7 @@ Create Date: 2022-06-28 12:37:08.506648 """ + from __future__ import annotations import sqlalchemy as sa diff --git a/minato_namikaze/lib/database/alembic/versions/ed7c318c1ec3_update.py b/minato_namikaze/lib/database/alembic/versions/ed7c318c1ec3_update.py index 2c3ed521..592220f7 100644 --- a/minato_namikaze/lib/database/alembic/versions/ed7c318c1ec3_update.py +++ b/minato_namikaze/lib/database/alembic/versions/ed7c318c1ec3_update.py @@ -5,6 +5,7 @@ Create Date: 2022-06-28 15:17:41.117219 """ + # revision identifiers, used by Alembic. from __future__ import annotations diff --git a/minato_namikaze/lib/functions/moderation.py b/minato_namikaze/lib/functions/moderation.py index 6ff496f4..260030a4 100644 --- a/minato_namikaze/lib/functions/moderation.py +++ b/minato_namikaze/lib/functions/moderation.py @@ -200,9 +200,11 @@ async def serverinfo( ) embed.add_field( name=":bell: Notifications", - value="All Messages " - if guild.default_notifications == discord.NotificationLevel.all_messages - else "Disabled", + value=( + "All Messages " + if guild.default_notifications == discord.NotificationLevel.all_messages + else "Disabled" + ), ) embed.add_field(name="Categories", value=len(guild.categories)) embed.add_field( diff --git a/minato_namikaze/lib/raid.py b/minato_namikaze/lib/raid.py index b0b6473e..b7f3a6d5 100644 --- a/minato_namikaze/lib/raid.py +++ b/minato_namikaze/lib/raid.py @@ -127,7 +127,7 @@ async def add_and_check_data( @tasks.loop(seconds=10.0) async def bulk_send_messages(self): async with self._batch_message_lock: - for ((guild_id, channel_id), messages) in self.message_batches.items(): + for (guild_id, channel_id), messages in self.message_batches.items(): guild = self.bot.get_guild(guild_id) channel = guild and guild.get_channel(channel_id) if channel is None: diff --git a/minato_namikaze/lib/util/utility.py b/minato_namikaze/lib/util/utility.py index ddc7075e..1613d91f 100644 --- a/minato_namikaze/lib/util/utility.py +++ b/minato_namikaze/lib/util/utility.py @@ -219,9 +219,11 @@ async def detect_bad_domains(message_content: str) -> list: if len(i.split("//")) != 0: try: parsed_url = urlparse( - i.lower().strip("/") - if i.split("://")[0].lower() in uses_netloc - else f'//{i.strip("/")}', + ( + i.lower().strip("/") + if i.split("://")[0].lower() in uses_netloc + else f'//{i.strip("/")}' + ), ) if parsed_url.hostname in list_of_bad_domains: detected_urls.append(parsed_url.hostname) diff --git a/minato_namikaze/lib/util/vars.py b/minato_namikaze/lib/util/vars.py index cd50cde0..688e1ea5 100644 --- a/minato_namikaze/lib/util/vars.py +++ b/minato_namikaze/lib/util/vars.py @@ -13,6 +13,7 @@ from sqlalchemy.orm import declarative_base + # only way to resolve the circular, yes this is the only way class _MissingSentinel: __slots__ = () diff --git a/minato_namikaze/old_outdated/setup_server.py b/minato_namikaze/old_outdated/setup_server.py index fd5a5e4d..325484cc 100644 --- a/minato_namikaze/old_outdated/setup_server.py +++ b/minato_namikaze/old_outdated/setup_server.py @@ -162,9 +162,11 @@ async def badlinks( "badlinks": { "option": option, "action": action, - "logging_channel": logging_channel.id - if logging_channel is not None - else logging_channel, + "logging_channel": ( + logging_channel.id + if logging_channel is not None + else logging_channel + ), }, }, ctx=ctx, diff --git a/minato_namikaze/slash/moderation.py b/minato_namikaze/slash/moderation.py index 6c8d86c7..12341675 100644 --- a/minato_namikaze/slash/moderation.py +++ b/minato_namikaze/slash/moderation.py @@ -428,11 +428,11 @@ class BadLinks(discord.SlashCommand, parent=Setup): description="Enable or Disable", default=True, ) - action: None | ( - typing.Literal["ban", "mute", "timeout", "kick", "log"] - ) = discord.application_command_option( - description="What kind of action to take", - default=None, + action: None | (typing.Literal["ban", "mute", "timeout", "kick", "log"]) = ( + discord.application_command_option( + description="What kind of action to take", + default=None, + ) ) channel: GuildChannel | None = discord.application_command_option( channel_types=[discord.TextChannel], @@ -455,9 +455,11 @@ async def callback(self, response: discord.SlashCommandResponse): "badlinks": { "option": response.options.option, "action": response.options.action, - "logging_channel": response.options.channel.id - if response.options.channel is not None - else response.options.channel, + "logging_channel": ( + response.options.channel.id + if response.options.channel is not None + else response.options.channel + ), }, }, response.interaction.guild,