Spaces:
Runtime error
Runtime error
measmonysuon
commited on
Commit
•
0f686ba
1
Parent(s):
d877af8
Update app.py
Browse files
app.py
CHANGED
@@ -83,14 +83,14 @@ def verify_otp(user_chat_id, otp):
|
|
83 |
|
84 |
def retrieve_user_points(user_chat_id, otp):
|
85 |
if not verify_otp(user_chat_id, otp):
|
86 |
-
return "Invalid or expired OTP. Please request a new OTP."
|
87 |
|
88 |
response = requests.get(f"{webhook_server}/get_points", params={"user_chat_id": user_chat_id})
|
89 |
if response.status_code == 200:
|
90 |
data = response.json()
|
91 |
points = data.get("points", 0)
|
92 |
-
return points
|
93 |
-
return "Error retrieving points. Please try again later."
|
94 |
|
95 |
def update_user_points(user_chat_id, points):
|
96 |
webhook_url = f"{webhook_server}/update_user_points"
|
|
|
83 |
|
84 |
def retrieve_user_points(user_chat_id, otp):
|
85 |
if not verify_otp(user_chat_id, otp):
|
86 |
+
return None, "Invalid or expired OTP. Please request a new OTP."
|
87 |
|
88 |
response = requests.get(f"{webhook_server}/get_points", params={"user_chat_id": user_chat_id})
|
89 |
if response.status_code == 200:
|
90 |
data = response.json()
|
91 |
points = data.get("points", 0)
|
92 |
+
return points, "OTA Verification and Points retrieved successfully."
|
93 |
+
return None, "Error retrieving points. Please try again later."
|
94 |
|
95 |
def update_user_points(user_chat_id, points):
|
96 |
webhook_url = f"{webhook_server}/update_user_points"
|