Update app.py
Browse files
app.py
CHANGED
|
@@ -61,7 +61,24 @@ if st.button("Verify"):
|
|
| 61 |
else:
|
| 62 |
st.error("You don't have enough yet 👻")
|
| 63 |
else:
|
| 64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
except Exception as e:
|
| 66 |
st.error(f"An error occurred: {e}")
|
| 67 |
else:
|
|
|
|
| 61 |
else:
|
| 62 |
st.error("You don't have enough yet 👻")
|
| 63 |
else:
|
| 64 |
+
adjusted_amount = 0
|
| 65 |
+
st.error("Token account not found or zero balance.")
|
| 66 |
+
|
| 67 |
+
# Log the query to Google Form
|
| 68 |
+
try:
|
| 69 |
+
form_url = "https://docs.google.com/forms/d/e/1FAIpQLSfsLawJnLd14ZGd8-fsbTdqGSsCSESe1w8Zd39wigDn6pvokQ/formResponse"
|
| 70 |
+
|
| 71 |
+
form_data = {
|
| 72 |
+
'entry.123456789': wallet_address, # Replace with your actual Wallet Address field name
|
| 73 |
+
'entry.987654321': f"{adjusted_amount:,.0f}" # Replace with your actual Token Amount field name
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
response = requests.post(form_url, data=form_data)
|
| 77 |
+
if response.status_code != 200:
|
| 78 |
+
st.warning("Failed to log data to Google Form.")
|
| 79 |
+
except Exception as e:
|
| 80 |
+
st.warning(f"Failed to log data to Google Form: {e}")
|
| 81 |
+
|
| 82 |
except Exception as e:
|
| 83 |
st.error(f"An error occurred: {e}")
|
| 84 |
else:
|