Skip to content

Commit

Permalink
fix: reorder UnVerified and Verified role operations
Browse files Browse the repository at this point in the history
  • Loading branch information
nihalxkumar committed Nov 5, 2024
1 parent e09cf42 commit d77792a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ async def on_submit(self, interaction: discord.Interaction):
if self.code.value != correct_code:
raise ValueError("Incorrect OTP")

# Remove UnVerified Role
unverified_role = discord.utils.get(interaction.guild.roles, name="UnVerified")

if not unverified_role:
raise ValueError("@UnVerified role not found")

await interaction.user.remove_roles(unverified_role)

# Add Verified Role
verified_role = discord.utils.get(interaction.guild.roles, name="Verified")
if not verified_role:
Expand Down

0 comments on commit d77792a

Please sign in to comment.