Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FirePlank committed Nov 21, 2023
1 parent 5c13693 commit 4835bb9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bot/extensions/selectable_roles/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ async def get(
):
"""Get the selected role"""

if not self.roles.get(interaction.guild.id):
return await interaction.response.send_message("There are no selectable roles!", ephemeral=True)
if not self.roles.get(interaction.guild.id) or not role.isdigit():
return await interaction.response.send_message("That role isn't selectable!", ephemeral=True)

role = interaction.guild.get_role(int(role))
if role is None:
return await interaction.response.send_message("That role doesn't exist!", ephemeral=True)
if role is None or not any(role.id == role_.id for role_ in self.roles[interaction.guild.id]):
return await interaction.response.send_message("That role isn't selectable!", ephemeral=True)

await interaction.user.add_roles(role, reason="Selectable role")

to_remove = []
Expand Down

0 comments on commit 4835bb9

Please sign in to comment.