Skip to content

Commit

Permalink
fix: reformat code for consistent indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalk0 committed Dec 12, 2023
1 parent afe72cf commit 3f9d149
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions commands/skyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ async def mods(self, interaction: discord.Interaction[ChouetteBot]):
api_github = "https://api.github.com/repos/"
async with aiohttp.ClientSession() as session:
async with session.get(
f"{api_github}Dungeons-Guide/Skyblock-Dungeons-Guide/releases/latest"
f"{api_github}Dungeons-Guide/Skyblock-Dungeons-Guide/releases/latest"
) as response:
dungeonsguide = await response.json()
async with session.get(
f"{api_github}Moulberry/NotEnoughUpdates/releases/latest"
f"{api_github}Moulberry/NotEnoughUpdates/releases/latest"
) as response:
notenoughupdates = await response.json()
async with session.get(
f"{api_github}BiscuitDevelopment/SkyblockAddons/releases/latest"
f"{api_github}BiscuitDevelopment/SkyblockAddons/releases/latest"
) as response:
skyblockaddons = await response.json()
async with session.get(
f"{api_github}Skytils/SkytilsMod/releases/latest"
f"{api_github}Skytils/SkytilsMod/releases/latest"
) as response:
skytils = await response.json()
await interaction.followup.send(
Expand Down Expand Up @@ -80,7 +80,7 @@ async def spider(self, interaction: discord.Interaction[ChouetteBot]):
)
else:
thunderstorm_duration = (
time_now + (3850 * 4 + 1000 * 4) - thunderstorm
time_now + (3850 * 4 + 1000 * 4) - thunderstorm
)
thunderstorm_msg = (
f"The thunderstorm will end <t:{thunderstorm_duration}:R>"
Expand All @@ -95,10 +95,10 @@ async def spider(self, interaction: discord.Interaction[ChouetteBot]):
)
@app_commands.rename(pseudo="pseudo_mc")
async def in_guild(
self, interaction: discord.Interaction[ChouetteBot], pseudo: str
self, interaction: discord.Interaction[ChouetteBot], pseudo: str
):
if interaction.user.get_role(
int(interaction.client.config["HYPIXEL_GUILD_ROLE"])
int(interaction.client.config["HYPIXEL_GUILD_ROLE"])
):
await interaction.response.send_message("Vous avez déjà le rôle !")
return
Expand Down
6 changes: 3 additions & 3 deletions commands/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def ping(interaction: discord.Interaction[ChouetteBot]):
# Make a cheh command
@app_commands.command(name="cheh", description="Cheh somebody")
async def cheh(
interaction: discord.Interaction[ChouetteBot], user: discord.Member
interaction: discord.Interaction[ChouetteBot], user: discord.Member
):
# Check if the user to cheh is the bot or the user sending the command
if user == interaction.client.user:
Expand All @@ -57,7 +57,7 @@ async def cheh(
@app_commands.checks.bot_has_permissions(manage_messages=True)
@app_commands.context_menu(name="Pin/Unpin")
async def pin(
interaction: discord.Interaction[ChouetteBot], message: discord.Message
interaction: discord.Interaction[ChouetteBot], message: discord.Message
):
if message.pinned:
await message.unpin()
Expand All @@ -79,7 +79,7 @@ async def pin(
@app_commands.checks.has_permissions(manage_messages=True)
@app_commands.context_menu(name="Delete until here")
async def delete(
interaction: discord.Interaction[ChouetteBot], message: discord.Message
interaction: discord.Interaction[ChouetteBot], message: discord.Message
):
await interaction.response.defer(ephemeral=True, thinking=True)
last_id = interaction.channel.last_message_id
Expand Down
6 changes: 3 additions & 3 deletions commands_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

# List of commands to add to the command tree
async def commands(
tree: discord.app_commands.CommandTree, hypixel_guild: discord.Guild
tree: discord.app_commands.CommandTree, hypixel_guild: discord.Guild
):
# Add the commands to the Tree
for command in COMMANDS_LIST:
Expand All @@ -39,8 +39,8 @@ async def commands(
# Create a global commands error handler
@tree.error
async def on_command_error(
interaction: discord.Interaction[ChouetteBot],
error: discord.app_commands.AppCommandError,
interaction: discord.Interaction[ChouetteBot],
error: discord.app_commands.AppCommandError,
):
if isinstance(error, discord.app_commands.BotMissingPermissions):
bot_perms = ", ".join(error.missing_permissions)
Expand Down
8 changes: 4 additions & 4 deletions responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@


async def responses(
client: ChouetteBot,
channel: Messageable,
message: str,
author: discord.User,
client: ChouetteBot,
channel: Messageable,
message: str,
author: discord.User,
) -> tuple[str, bool]:
# Checks if a message ends with quoi
if "".join(filter(str.isalpha, message)).lower().endswith("quoi"):
Expand Down
4 changes: 2 additions & 2 deletions src/skyblock_guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ async def return_uuid(session, pseudo):
except Exception:
# This Minecraft pseudo doesn't exist
if (
response["errorMessage"]
== f"Couldn't find any profile with name {pseudo}"
response["errorMessage"]
== f"Couldn't find any profile with name {pseudo}"
):
return 0
return
Expand Down

0 comments on commit 3f9d149

Please sign in to comment.