Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 29, 2024
1 parent b278595 commit d5b0ce5
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 58 deletions.
4 changes: 3 additions & 1 deletion src/exts/core/author.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,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: str = "https://discord.com/oauth2/authorize?client_id=809084067446259722&permissions=1644905889023&scope=bot%20applications.commands"
self.invite: str = (
"https://discord.com/oauth2/authorize?client_id=809084067446259722&permissions=1644905889023&scope=bot%20applications.commands"
)

@hybrid_slash_command(
name="about",
Expand Down
4 changes: 3 additions & 1 deletion src/exts/fun/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 5 additions & 3 deletions src/exts/fun/hug.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down
40 changes: 25 additions & 15 deletions src/exts/fun/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,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)
Expand Down Expand Up @@ -79,9 +81,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)
Expand Down Expand Up @@ -149,9 +153,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)
Expand Down Expand Up @@ -203,9 +209,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,
Expand Down Expand Up @@ -254,9 +262,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,
}
Expand Down
4 changes: 3 additions & 1 deletion src/exts/fun/petpet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
30 changes: 18 additions & 12 deletions src/exts/fun/tictactoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
Expand Down
10 changes: 6 additions & 4 deletions src/exts/fun/whos_that_pokemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,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(correct_pokemon["num"])
else interactions.ButtonStyle.SUCCESS,
style=(
interactions.ButtonStyle.SECONDARY
if str(pokemon_list[i]["num"])
!= str(correct_pokemon["num"])
else interactions.ButtonStyle.SUCCESS
),
label=f"{pokemon_list[i]['name']}",
custom_id=f"{pokemon_list[i]['num']}",
disabled=True,
Expand Down
54 changes: 33 additions & 21 deletions src/exts/utils/emoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,11 @@ async def info(self, ctx: interactions.SlashContext, emoji: str) -> None:

image = interactions.EmbedAttachment(url=_url)
embed = interactions.Embed(
title=f"``<a:{emote.name}:{emote.id}>``"
if emote.animated
else f"``<:{emote.name}:{emote.id}>``",
title=(
f"``<a:{emote.name}:{emote.id}>``"
if emote.animated
else f"``<:{emote.name}:{emote.id}>``"
),
description="".join(
[
f"[Emoji link]({_url})\n",
Expand Down Expand Up @@ -187,9 +189,11 @@ async def info(self, ctx: interactions.SlashContext, emoji: str) -> None:
)
image = interactions.EmbedAttachment(url=url)
embed = interactions.Embed(
title=f"``<a:{_emoji.name}:{_emoji.id}>``"
if _emoji.animated
else f"``<:{_emoji.name}:{_emoji.id}>``",
title=(
f"``<a:{_emoji.name}:{_emoji.id}>``"
if _emoji.animated
else f"``<:{_emoji.name}:{_emoji.id}>``"
),
description="".join(
[
f"[Emoji link]({url})\n",
Expand Down Expand Up @@ -229,9 +233,11 @@ async def info(self, ctx: interactions.SlashContext, emoji: str) -> None:
)
image = interactions.EmbedAttachment(url=url)
embed = interactions.Embed(
title=f"``<a:{_emoji.name}:{_emoji.id}>``"
if _emoji.animated
else f"``<:{_emoji.name}:{_emoji.id}>``",
title=(
f"``<a:{_emoji.name}:{_emoji.id}>``"
if _emoji.animated
else f"``<:{_emoji.name}:{_emoji.id}>``"
),
description="".join(
[
f"[Emoji link]({url})\n",
Expand Down Expand Up @@ -315,9 +321,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:
Expand Down Expand Up @@ -362,9 +368,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:
Expand Down Expand Up @@ -474,9 +482,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(
Expand Down Expand Up @@ -522,9 +532,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(
Expand Down

0 comments on commit d5b0ce5

Please sign in to comment.