Skip to content

Commit

Permalink
update email api endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
f1delius committed Jul 3, 2024
1 parent f782bfe commit 00fd0a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ async def invite_bot_to_room(tool_id, session):
async def enable_api(conn, userId, session):
try:
email_id = await session.get(f"https://bots.pixx.co/user/{userId}")
conn.execute(f"INSERT OR REPLACE INTO bot VALUES ('{userId.text}', '{email_id}')")
email_id.raise_for_status()
email = email_id.json()["email"]
conn.execute(f"INSERT OR REPLACE INTO bot VALUES ('{userId}', '{email}')")
except Exception as e:
logger.error(f"email api: {e}")
return False
Expand Down

0 comments on commit 00fd0a9

Please sign in to comment.