Update main.py
Browse files
main.py
CHANGED
@@ -78,14 +78,18 @@ def toggle_free_mode(user_id):
|
|
78 |
response = requests.post(f"https://private-akeno.randydev.my.id/api/v2/akenohub/freemode?user_id={user_id}")
|
79 |
return response.json()
|
80 |
except requests.RequestException as e:
|
81 |
-
return {"message":
|
82 |
|
83 |
-
def
|
|
|
84 |
try:
|
85 |
-
response = requests.get(
|
86 |
-
|
|
|
|
|
|
|
87 |
except requests.RequestException as e:
|
88 |
-
return {"expired": True, "free_mode": False, "
|
89 |
|
90 |
@client.on_message(
|
91 |
filters.incoming
|
@@ -206,7 +210,6 @@ async def searchhub(client: Client, message: Message):
|
|
206 |
await message.reply("Free mode is active. Sending unprotected content.")
|
207 |
else:
|
208 |
await message.reply("Free mode is inactive or expired. Sending protected content.")
|
209 |
-
|
210 |
response = await api.x_search(query=query)
|
211 |
if response is None:
|
212 |
return await pro.edit_text("nothing found gay")
|
|
|
78 |
response = requests.post(f"https://private-akeno.randydev.my.id/api/v2/akenohub/freemode?user_id={user_id}")
|
79 |
return response.json()
|
80 |
except requests.RequestException as e:
|
81 |
+
return {"message": "Error toggling free mode: ok", "free_mode_enabled": False}
|
82 |
|
83 |
+
def check_user_expiration(user_id: int):
|
84 |
+
url = f"https://private-akeno.randydev.my.id/api/v2/akenohub/check?user_id={user_id}"
|
85 |
try:
|
86 |
+
response = requests.get(url)
|
87 |
+
if response.status_code == 200:
|
88 |
+
return response.json()
|
89 |
+
else:
|
90 |
+
return {"expired": True, "free_mode": False}
|
91 |
except requests.RequestException as e:
|
92 |
+
return {"expired": True, "free_mode": False, "error": "ok"}
|
93 |
|
94 |
@client.on_message(
|
95 |
filters.incoming
|
|
|
210 |
await message.reply("Free mode is active. Sending unprotected content.")
|
211 |
else:
|
212 |
await message.reply("Free mode is inactive or expired. Sending protected content.")
|
|
|
213 |
response = await api.x_search(query=query)
|
214 |
if response is None:
|
215 |
return await pro.edit_text("nothing found gay")
|