Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -129,21 +129,27 @@ def blacklist_words():
|
|
129 |
except Exception as e:
|
130 |
return {"status": "false", "message": f"Internal server error: {str(e)}"}
|
131 |
|
132 |
-
@app.delete("/UFoP/bandel")
|
133 |
def sibyl_system_delete(
|
134 |
-
|
135 |
api_key: None = Depends(validate_api_key_only_devs)
|
136 |
):
|
137 |
try:
|
138 |
-
_, _, _, _, sibyl_user_id = db.get_sibyl_system_banned(user_id)
|
139 |
|
140 |
if sibyl_user_id:
|
141 |
-
db.remove_sibyl_system_banned(user_id)
|
142 |
-
return
|
|
|
|
|
|
|
143 |
else:
|
144 |
-
return
|
|
|
|
|
|
|
145 |
except Exception as e:
|
146 |
-
return
|
147 |
|
148 |
@app.post("/UFoP/banner")
|
149 |
def sibyl_system_ban(
|
|
|
129 |
except Exception as e:
|
130 |
return {"status": "false", "message": f"Internal server error: {str(e)}"}
|
131 |
|
132 |
+
@app.delete("/UFoP/bandel", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}}))
|
133 |
def sibyl_system_delete(
|
134 |
+
item: SibylSystemDel,
|
135 |
api_key: None = Depends(validate_api_key_only_devs)
|
136 |
):
|
137 |
try:
|
138 |
+
_, _, _, _, sibyl_user_id = db.get_sibyl_system_banned(item.user_id)
|
139 |
|
140 |
if sibyl_user_id:
|
141 |
+
db.remove_sibyl_system_banned(item.user_id)
|
142 |
+
return SuccessResponse(
|
143 |
+
status="True",
|
144 |
+
randydev={"message": f"Successfully removed {item.user_id} from the Sibyl ban list"}
|
145 |
+
)
|
146 |
else:
|
147 |
+
return SuccessResponse(
|
148 |
+
status="False",
|
149 |
+
randydev={"message": "Not Found UserID"}
|
150 |
+
)
|
151 |
except Exception as e:
|
152 |
+
return ErrorStatus(status="false", message=f"Internal server error: {str(e)}")
|
153 |
|
154 |
@app.post("/UFoP/banner")
|
155 |
def sibyl_system_ban(
|