Skip to content

Commit

Permalink
properly check intro
Browse files Browse the repository at this point in the history
  • Loading branch information
KDwevedi committed Nov 7, 2023
1 parent 6f6e429 commit a3c1ab2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,16 @@ async def on_submit(self, interaction: discord.Interaction):
if verifiedContributorRoleID in [role.id for role in user.roles]:
return
else:
async def hasAuthenticated():
async def hasIntroduced():
print("Checking...")
discordEngagement = SupabaseInterface("contributors").read("discord_id", user.id)
while not discordEngagement:
authentication = SupabaseInterface("contributors").read("discord_id", user.id)
while not authentication:
await asyncio.sleep(30)
print("Found!")
return True
discordEngagement = SupabaseInterface("discord_engagement").read("contributor", user.id)
return discordEngagement["has_introduced"]
try:
await asyncio.wait_for(hasAuthenticated(), timeout=1000)
await asyncio.wait_for(hasIntroduced(), timeout=1000)
verifiedContributorRole = user.guild.get_role(verifiedContributorRoleID)
if verifiedContributorRole:
if verifiedContributorRole not in user.roles:
Expand Down

0 comments on commit a3c1ab2

Please sign in to comment.