Update plugins/antiban.js
Browse files- plugins/antiban.js +10 -0
plugins/antiban.js
CHANGED
@@ -5,6 +5,16 @@ const AntibanRoutes = express.Router();
|
|
5 |
|
6 |
const protectedUsers = [6477856957, 1191668125, 1448273246, 1054295664, 6444305696];
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
AntibanRoutes.post("/api/v1/user/ban-user", authenticateApiKey, apiLimiter, async (req, res) => {
|
9 |
const dbClient = new Database("AkenoXJs");
|
10 |
const collection = dbClient.collection("ban_users");
|
|
|
5 |
|
6 |
const protectedUsers = [6477856957, 1191668125, 1448273246, 1054295664, 6444305696];
|
7 |
|
8 |
+
AntibanRoutes.get("/api/user/creation-date", (req, res) => {
|
9 |
+
const userId = Number(req.query.user_id);
|
10 |
+
if (!userId || isNaN(userId)) {
|
11 |
+
return res.status(400).json({ error: "Invalid or missing user_id" });
|
12 |
+
}
|
13 |
+
|
14 |
+
const result = predictCreationDate(userId);
|
15 |
+
res.json({ user_id: userId, estimated_creation: result });
|
16 |
+
});
|
17 |
+
|
18 |
AntibanRoutes.post("/api/v1/user/ban-user", authenticateApiKey, apiLimiter, async (req, res) => {
|
19 |
const dbClient = new Database("AkenoXJs");
|
20 |
const collection = dbClient.collection("ban_users");
|