diff --git a/src/exts/core/author.py b/src/exts/core/author.py index 6a9d12e..6eaa884 100644 --- a/src/exts/core/author.py +++ b/src/exts/core/author.py @@ -20,7 +20,9 @@ def __init__(self, client: interactions.Client) -> None: self.client: interactions.Client = client self.topgg: str = "https://top.gg/bot/809084067446259722" self.github: str = "https://github.com/B1ue-Dev/Articuno" - self.invite_url: str = "https://discord.com/oauth2/authorize?client_id=809084067446259722&permissions=1644905889023&scope=bot%20applications.commands" + self.invite_url: str = ( + "https://discord.com/oauth2/authorize?client_id=809084067446259722&permissions=1644905889023&scope=bot%20applications.commands" + ) @interactions.slash_command( name="about", diff --git a/src/exts/fun/google.py b/src/exts/fun/google.py index 0be62c2..ef5c880 100644 --- a/src/exts/fun/google.py +++ b/src/exts/fun/google.py @@ -37,7 +37,9 @@ class Google(interactions.Extension): def __init__(self, client: interactions.Client) -> None: self.client: interactions.Client = client - self.google_icon: str = "https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Google_%22G%22_Logo.svg/2048px-Google_%22G%22_Logo.svg.png" + self.google_icon: str = ( + "https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Google_%22G%22_Logo.svg/2048px-Google_%22G%22_Logo.svg.png" + ) @hybrid_slash_command( name="img", diff --git a/src/exts/fun/hangman.py b/src/exts/fun/hangman.py index eb33ed0..a04031d 100644 --- a/src/exts/fun/hangman.py +++ b/src/exts/fun/hangman.py @@ -674,9 +674,11 @@ async def hangman_leaderboard(self, ctx: HybridContext) -> None: ) await paginator.send( ctx=ctx, - content=f"You are at top {current_position}." - if current_position != 0 - else "", + content=( + f"You are at top {current_position}." + if current_position != 0 + else "" + ), ) diff --git a/src/exts/fun/hug.py b/src/exts/fun/hug.py index 198020e..5768aa3 100644 --- a/src/exts/fun/hug.py +++ b/src/exts/fun/hug.py @@ -97,9 +97,11 @@ async def hug(self, ctx: HybridContext, user: interactions.Member) -> None: ) await ctx.send( - content="Hey, thanks for the hug. ^_^" - if int(user.id) == int(self.client.user.id) - else None, + content=( + "Hey, thanks for the hug. ^_^" + if int(user.id) == int(self.client.user.id) + else None + ), files=file, ) diff --git a/src/exts/fun/misc.py b/src/exts/fun/misc.py index 941b313..f8b63ef 100644 --- a/src/exts/fun/misc.py +++ b/src/exts/fun/misc.py @@ -44,9 +44,11 @@ async def jail( url: str = "https://some-random-api.com/canvas/jail" params: dict = { - "avatar": user.avatar.url - if user.guild_avatar is None - else user.guild_avatar.url, + "avatar": ( + user.avatar.url + if user.guild_avatar is None + else user.guild_avatar.url + ), } resp = await get_response(url, params) @@ -80,9 +82,11 @@ async def tonikawa( url: str = "https://some-random-api.com/canvas/tonikawa" params: dict = { - "avatar": user.avatar.url - if user.guild_avatar is None - else user.guild_avatar.url, + "avatar": ( + user.avatar.url + if user.guild_avatar is None + else user.guild_avatar.url + ), } resp = await get_response(url, params) @@ -150,9 +154,11 @@ async def trigger( url: str = "https://some-random-api.com/canvas/triggered" params: dict = { - "avatar": user.avatar.url - if user.guild_avatar is None - else user.guild_avatar.url, + "avatar": ( + user.avatar.url + if user.guild_avatar is None + else user.guild_avatar.url + ), } resp = await get_response(url, params) @@ -204,9 +210,11 @@ async def tweet( nick = username url: str = "https://some-random-api.com/canvas/tweet" params: dict = { - "avatar": user.avatar.url - if user.guild_avatar is None - else user.guild_avatar.url, + "avatar": ( + user.avatar.url + if user.guild_avatar is None + else user.guild_avatar.url + ), "username": username, "displayname": nick, "comment": comment, @@ -255,9 +263,11 @@ async def youtube( username = user.user.username url = "https://some-random-api.com/canvas/youtube-comment" params = { - "avatar": user.avatar.url - if user.guild_avatar is None - else user.guild_avatar.url, + "avatar": ( + user.avatar.url + if user.guild_avatar is None + else user.guild_avatar.url + ), "username": username, "comment": comment, } @@ -299,9 +309,11 @@ async def amogus( text = f"""{user.user.username} was {"not" if str(random.choice(["true", "false"])) == "false" else ""} The Impostor""" url: str = "https://some-random-api.com/premium/amongus" params: dict = { - "avatar": user.avatar.url - if user.guild_avatar is None - else user.guild_avatar.url, + "avatar": ( + user.avatar.url + if user.guild_avatar is None + else user.guild_avatar.url + ), "username": user.user.username, "custom": text, "key": "hello", diff --git a/src/exts/fun/petpet.py b/src/exts/fun/petpet.py index 8043867..017e52e 100644 --- a/src/exts/fun/petpet.py +++ b/src/exts/fun/petpet.py @@ -51,7 +51,9 @@ async def pet(self, ctx: HybridContext, user: interactions.Member) -> None: if _hash.isdigit(): _url: str = f"https://cdn.discordapp.com/embed/avatars/{_hash}.png" else: - _url: str = f"https://cdn.discordapp.com/avatars/{str(user.user.id)}/{_hash}.png" + _url: str = ( + f"https://cdn.discordapp.com/avatars/{str(user.user.id)}/{_hash}.png" + ) member_avatar = Image.open(await get_response(_url)).convert("RGBA") member_avatar = member_avatar.resize( diff --git a/src/exts/fun/tictactoe.py b/src/exts/fun/tictactoe.py index 302e917..96053d7 100644 --- a/src/exts/fun/tictactoe.py +++ b/src/exts/fun/tictactoe.py @@ -510,21 +510,27 @@ async def process_turn(self, ctx: interactions.ComponentContext) -> None: content = f"{ctx.author.mention}'s tic tac toe game " + ( "(easy mode)" if ctx.message.content.find("easy mode") != -1 - else "(hard mode)" - if ctx.message.content.find("hard mode") != -1 - else "(medium mode)" + else ( + "(hard mode)" + if ctx.message.content.find("hard mode") != -1 + else "(medium mode)" + ) ) await ctx.edit_origin( - content=content - if not winner - else f"{winner} has won! " - + ( - "(easy mode)" - if ctx.message.content.find("easy mode") != -1 - else "(hard mode)" - if ctx.message.content.find("hard mode") != -1 - else "(medium mode)" + content=( + content + if not winner + else f"{winner} has won! " + + ( + "(easy mode)" + if ctx.message.content.find("easy mode") != -1 + else ( + "(hard mode)" + if ctx.message.content.find("hard mode") != -1 + else "(medium mode)" + ) + ) ), components=render_board(board, disable=winner is not None), ) diff --git a/src/exts/fun/whos_that_pokemon.py b/src/exts/fun/whos_that_pokemon.py index 51ea28d..6d229df 100644 --- a/src/exts/fun/whos_that_pokemon.py +++ b/src/exts/fun/whos_that_pokemon.py @@ -212,10 +212,12 @@ def _check(_ctx): for i in range(4): _button_disabled.append( interactions.Button( - style=interactions.ButtonStyle.SECONDARY - if str(pokemon_list[i]["num"]) - != str(corrected_pokemon.num) - else interactions.ButtonStyle.SUCCESS, + style=( + interactions.ButtonStyle.SECONDARY + if str(pokemon_list[i]["num"]) + != str(corrected_pokemon.num) + else interactions.ButtonStyle.SUCCESS + ), label=f"{pokemon_list[i]['name']}", custom_id=f"{pokemon_list[i]['num']}", disabled=True, diff --git a/src/exts/utils/emoji.py b/src/exts/utils/emoji.py index 66f89da..70d0299 100644 --- a/src/exts/utils/emoji.py +++ b/src/exts/utils/emoji.py @@ -157,9 +157,11 @@ async def info(self, ctx: interactions.SlashContext, emoji: str) -> None: image = interactions.EmbedAttachment(url=_url) embed = interactions.Embed( - title=f"````" - if emote.animated - else f"``<:{emote.name}:{emote.id}>``", + title=( + f"````" + if emote.animated + else f"``<:{emote.name}:{emote.id}>``" + ), description="".join( [ f"[Emoji link]({_url})\n", @@ -199,9 +201,11 @@ async def info(self, ctx: interactions.SlashContext, emoji: str) -> None: ) image = interactions.EmbedAttachment(url=url) embed = interactions.Embed( - title=f"````" - if _emoji.animated - else f"``<:{_emoji.name}:{_emoji.id}>``", + title=( + f"````" + if _emoji.animated + else f"``<:{_emoji.name}:{_emoji.id}>``" + ), description="".join( [ f"[Emoji link]({url})\n", @@ -241,9 +245,11 @@ async def info(self, ctx: interactions.SlashContext, emoji: str) -> None: ) image = interactions.EmbedAttachment(url=url) embed = interactions.Embed( - title=f"````" - if _emoji.animated - else f"``<:{_emoji.name}:{_emoji.id}>``", + title=( + f"````" + if _emoji.animated + else f"``<:{_emoji.name}:{_emoji.id}>``" + ), description="".join( [ f"[Emoji link]({url})\n", @@ -327,9 +333,9 @@ async def steal( _io = (io.BytesIO(await resp.read())).read() image = interactions.File( - file_name="unknown.gif" - if emote.animated - else "unknown.png", + file_name=( + "unknown.gif" if emote.animated else "unknown.png" + ), file=_io, ) try: @@ -374,9 +380,11 @@ async def steal( _io = (io.BytesIO(await resp.read())).read() image = interactions.File( - file_name="unknown.gif" - if str(resp.content_type) == "image/gif" - else "unknown.png", + file_name=( + "unknown.gif" + if str(resp.content_type) == "image/gif" + else "unknown.png" + ), file=_io, ) try: @@ -486,9 +494,11 @@ async def add( _io = (io.BytesIO(await resp.read())).read() image = interactions.File( file=_io, - file_name="unknown.gif" - if resp.content_type == "image/gif" - else "unknown.png", + file_name=( + "unknown.gif" + if resp.content_type == "image/gif" + else "unknown.png" + ), ) try: e = await ctx.guild.create_custom_emoji( @@ -534,9 +544,11 @@ async def add( _io = (io.BytesIO(await resp.read())).read() image = interactions.File( file=_io, - file_name="unknown.gif" - if resp.content_type == "image/gif" - else "unknown.png", + file_name=( + "unknown.gif" + if resp.content_type == "image/gif" + else "unknown.png" + ), ) try: e = await ctx.guild.create_custom_emoji( @@ -675,9 +687,11 @@ async def user_get_emoji( image = interactions.EmbedAttachment(url=_emoji.url) embed = interactions.Embed( - title=f"````" - if _emoji.animated - else f"``<:{_emoji.name}:{_emoji.id}>``", + title=( + f"````" + if _emoji.animated + else f"``<:{_emoji.name}:{_emoji.id}>``" + ), description="".join( [ f"[Emoji link]({_emoji.url})\n", @@ -701,9 +715,11 @@ async def user_get_emoji( image = interactions.EmbedAttachment(url=_emoji.url) embed = interactions.Embed( - title=f"````" - if _emoji.animated - else f"``<:{_emoji.name}:{_emoji.id}>``", + title=( + f"````" + if _emoji.animated + else f"``<:{_emoji.name}:{_emoji.id}>``" + ), description="".join( [ f"[Emoji link]({_emoji.url})\n", diff --git a/src/utils/error_handler.py b/src/utils/error_handler.py index bd2ab51..1b862f6 100644 --- a/src/utils/error_handler.py +++ b/src/utils/error_handler.py @@ -145,8 +145,7 @@ async def on_command_error( elif isinstance(event.error, interactions.errors.CommandCheckFailure): - class Null: - ... + class Null: ... return Null