Skip to content

Commit

Permalink
Merge pull request #50 from Tibo-Ulens/hotfix
Browse files Browse the repository at this point in the history
fix wrong check in member join listener
  • Loading branch information
Tibo-Ulens authored Sep 20, 2023
2 parents 63f97f5 + 7f460fc commit 2c041a9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bot/extensions/moderation/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,15 @@ async def handle_member_join(self, member: Member):
if guild_config is None or guild_config.verified_role is None:
return

# Ensure the profile exists
profile = await Profile.find_by_discord_id(member.id)
if profile is None:
return

# If the profile is already verified somewhere else, verify them here
# as well
if profile.email is not None and profile.confirmation_code is None:
if (
profile is not None
and profile.email is not None
and profile.confirmation_code is None
):
await member.add_roles(
discord.utils.get(guild.roles, id=guild_config.verified_role)
)
Expand Down

0 comments on commit 2c041a9

Please sign in to comment.