Skip to content

Commit

Permalink
Fix lint/type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
raccube committed Aug 28, 2024
1 parent 2826826 commit c591c09
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
23 changes: 12 additions & 11 deletions src/commands/passwd.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ async def passwd(
'\n'.join([f"**{team}:** {password}" for team, password in interaction.client.passwords.items()]),
ephemeral=True,
)
if new_password is not None:
if not interaction.user.guild_permissions.administrator:
await interaction.response.send_message(
"You do not have permission to change team passwords.",
ephemeral=True
)
return
interaction.client.set_password(tla, new_password)
await interaction.response.send_message(f"The password for {tla.upper()} has been changed.", ephemeral=True)
else:
password = interaction.client.passwords[tla]
await interaction.response.send_message(f"The password for {tla.upper()} is `{password}`", ephemeral=True)
if new_password is not None:
if isinstance(interaction.user, discord.Member) and not interaction.user.guild_permissions.administrator:
await interaction.response.send_message(
"You do not have permission to change team passwords.",
ephemeral=True
)
return
interaction.client.set_password(tla, new_password)
await interaction.response.send_message(f"The password for {tla.upper()} has been changed.", ephemeral=True)
else:
password = interaction.client.passwords[tla]
await interaction.response.send_message(f"The password for {tla.upper()} is `{password}`", ephemeral=True)
2 changes: 1 addition & 1 deletion src/commands/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
@app_commands.guild_only()
@app_commands.default_permissions()
class Team(app_commands.Group):
def __init__(self):
def __init__(self) -> None:
super().__init__(description="Manage teams")


Expand Down

0 comments on commit c591c09

Please sign in to comment.