Skip to content

Commit

Permalink
Adding exception handling to contributors.
Browse files Browse the repository at this point in the history
  • Loading branch information
karntrehan committed Sep 25, 2024
1 parent 024b6f6 commit 6203e12
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ async def post_data(self, data):

async def on_submit(self, interaction: discord.Interaction):
user = interaction.user
supaClient = SupabaseClient()
await interaction.response.send_message(
"Thanks! Now please sign in via Github!",
view=AuthenticationView(user.id),
Expand All @@ -92,15 +93,18 @@ async def on_submit(self, interaction: discord.Interaction):
else:
async def hasIntroduced():
print("Checking hasIntroduced...")
authentication = SupabaseClient().read(
"contributors_registration", "discord_id", user.id
)
try:
authentication = supaClient.read(
"contributors_registration", "discord_id", user.id
)
except Exception as e:
print("Failed hasIntroduced"+e)
print("Authentication: "+authentication)
while not authentication:
print("Not authenticated")
await asyncio.sleep(30)
print("Found!")
discordEngagement = SupabaseClient().read(
discordEngagement = supaClient.read(
"discord_engagement", "contributor", user.id
)[0]
print("Discord engagement: "+discordEngagement)
Expand Down

0 comments on commit 6203e12

Please sign in to comment.