Update plugins/antiban.js
Browse files- plugins/antiban.js +14 -164
plugins/antiban.js
CHANGED
@@ -94,29 +94,7 @@ const GetAuthorChat = async (username) => {
|
|
94 |
}
|
95 |
}
|
96 |
|
97 |
-
|
98 |
-
* @swagger
|
99 |
-
* /api/v1/user/status/ban:
|
100 |
-
* get:
|
101 |
-
* summary: Telegram User Status Ban
|
102 |
-
* tags: [User]
|
103 |
-
* parameters:
|
104 |
-
* - in: query
|
105 |
-
* name: username
|
106 |
-
* required: true
|
107 |
-
* description: null
|
108 |
-
* schema:
|
109 |
-
* type: string
|
110 |
-
* - in: header
|
111 |
-
* name: x-api-key
|
112 |
-
* required: true
|
113 |
-
* description: API key for authentication
|
114 |
-
* schema:
|
115 |
-
* type: string
|
116 |
-
* responses:
|
117 |
-
* 200:
|
118 |
-
* description: Success
|
119 |
-
*/
|
120 |
AntibanRoutes.get("/api/v1/user/status/ban", authenticateApiKey, apiLimiter, async (req, res) => {
|
121 |
const Username = req.query.username;
|
122 |
if (!Username) {
|
@@ -129,30 +107,9 @@ AntibanRoutes.get("/api/v1/user/status/ban", authenticateApiKey, apiLimiter, asy
|
|
129 |
res.status(500).json({ error: "Failed to fetch user info" });
|
130 |
}
|
131 |
});
|
|
|
132 |
|
133 |
-
|
134 |
-
* @swagger
|
135 |
-
* /api/v1/user/author/admin:
|
136 |
-
* get:
|
137 |
-
* summary: Telegram Author Admin
|
138 |
-
* tags: [User]
|
139 |
-
* parameters:
|
140 |
-
* - in: query
|
141 |
-
* name: username
|
142 |
-
* required: true
|
143 |
-
* description: null
|
144 |
-
* schema:
|
145 |
-
* type: string
|
146 |
-
* - in: header
|
147 |
-
* name: x-api-key
|
148 |
-
* required: true
|
149 |
-
* description: API key for authentication
|
150 |
-
* schema:
|
151 |
-
* type: string
|
152 |
-
* responses:
|
153 |
-
* 200:
|
154 |
-
* description: Success
|
155 |
-
*/
|
156 |
AntibanRoutes.get("/api/v1/user/author/admin", authenticateApiKey, apiLimiter, async (req, res) => {
|
157 |
const Username = req.query.username;
|
158 |
if (!Username) {
|
@@ -165,31 +122,9 @@ AntibanRoutes.get("/api/v1/user/author/admin", authenticateApiKey, apiLimiter, a
|
|
165 |
res.status(500).json({ error: "Failed to fetch user info" });
|
166 |
}
|
167 |
});
|
|
|
168 |
|
169 |
-
|
170 |
-
/**
|
171 |
-
* @swagger
|
172 |
-
* /api/v1/user/raw/getchat:
|
173 |
-
* get:
|
174 |
-
* summary: Telegram Get Chat
|
175 |
-
* tags: [User]
|
176 |
-
* parameters:
|
177 |
-
* - in: query
|
178 |
-
* name: username
|
179 |
-
* required: true
|
180 |
-
* description: null
|
181 |
-
* schema:
|
182 |
-
* type: string
|
183 |
-
* - in: header
|
184 |
-
* name: x-api-key
|
185 |
-
* required: true
|
186 |
-
* description: API key for authentication
|
187 |
-
* schema:
|
188 |
-
* type: string
|
189 |
-
* responses:
|
190 |
-
* 200:
|
191 |
-
* description: Success
|
192 |
-
*/
|
193 |
AntibanRoutes.get("/api/v1/user/raw/getchat", authenticateApiKey, apiLimiter, async (req, res) => {
|
194 |
const Username = req.query.username;
|
195 |
if (!Username) {
|
@@ -202,30 +137,9 @@ AntibanRoutes.get("/api/v1/user/raw/getchat", authenticateApiKey, apiLimiter, as
|
|
202 |
res.status(500).json({ error: "Failed to fetch user info" });
|
203 |
}
|
204 |
});
|
|
|
205 |
|
206 |
-
|
207 |
-
* @swagger
|
208 |
-
* /api/v1/user/story/task:
|
209 |
-
* get:
|
210 |
-
* summary: Telegram User Story Downloader
|
211 |
-
* tags: [User]
|
212 |
-
* parameters:
|
213 |
-
* - in: query
|
214 |
-
* name: story_url
|
215 |
-
* required: true
|
216 |
-
* description: Telegram Story URL to download
|
217 |
-
* schema:
|
218 |
-
* type: string
|
219 |
-
* - in: header
|
220 |
-
* name: x-api-key
|
221 |
-
* required: true
|
222 |
-
* description: API key for authentication
|
223 |
-
* schema:
|
224 |
-
* type: string
|
225 |
-
* responses:
|
226 |
-
* 200:
|
227 |
-
* description: Download started successfully
|
228 |
-
*/
|
229 |
AntibanRoutes.get("/api/v1/user/story/task", authenticateApiKey, apiLimiter, async (req, res) => {
|
230 |
const Links = req.query.story_url;
|
231 |
if (!Links) {
|
@@ -251,30 +165,9 @@ AntibanRoutes.get("/api/v1/user/story/task", authenticateApiKey, apiLimiter, asy
|
|
251 |
|
252 |
res.json({ message: "Download started", status: "processing", job_id });
|
253 |
});
|
|
|
254 |
|
255 |
-
|
256 |
-
* @swagger
|
257 |
-
* /api/v1/user/story/task/{job_id}:
|
258 |
-
* delete:
|
259 |
-
* summary: Check Telegram User Story Delete Job ID
|
260 |
-
* tags: [User]
|
261 |
-
* parameters:
|
262 |
-
* - in: path
|
263 |
-
* name: job_id
|
264 |
-
* required: true
|
265 |
-
* description: Job ID to delete
|
266 |
-
* schema:
|
267 |
-
* type: string
|
268 |
-
* - in: header
|
269 |
-
* name: x-api-key
|
270 |
-
* required: true
|
271 |
-
* description: API key for authentication
|
272 |
-
* schema:
|
273 |
-
* type: string
|
274 |
-
* responses:
|
275 |
-
* 200:
|
276 |
-
* description: Returns job Has been deleted
|
277 |
-
*/
|
278 |
AntibanRoutes.delete("/api/v1/user/story/task/:job_id", authenticateApiKey, apiLimiter, async (req, res) => {
|
279 |
const { job_id } = req.params;
|
280 |
|
@@ -285,31 +178,9 @@ AntibanRoutes.delete("/api/v1/user/story/task/:job_id", authenticateApiKey, apiL
|
|
285 |
}
|
286 |
res.json({ message: "Job deleted successfully", job_id });
|
287 |
});
|
|
|
288 |
|
289 |
-
|
290 |
-
/**
|
291 |
-
* @swagger
|
292 |
-
* /api/v1/user/story/task/{job_id}:
|
293 |
-
* get:
|
294 |
-
* summary: Check Telegram User Story Download Status
|
295 |
-
* tags: [User]
|
296 |
-
* parameters:
|
297 |
-
* - in: path
|
298 |
-
* name: job_id
|
299 |
-
* required: true
|
300 |
-
* description: Job ID to check download status
|
301 |
-
* schema:
|
302 |
-
* type: string
|
303 |
-
* - in: header
|
304 |
-
* name: x-api-key
|
305 |
-
* required: true
|
306 |
-
* description: API key for authentication
|
307 |
-
* schema:
|
308 |
-
* type: string
|
309 |
-
* responses:
|
310 |
-
* 200:
|
311 |
-
* description: Returns job status and story bytes if completed
|
312 |
-
*/
|
313 |
AntibanRoutes.get("/api/v1/user/story/task/:job_id", authenticateApiKey, apiLimiter, async (req, res) => {
|
314 |
const job = await Job.findOne({ job_id: req.params.job_id });
|
315 |
|
@@ -321,30 +192,9 @@ AntibanRoutes.get("/api/v1/user/story/task/:job_id", authenticateApiKey, apiLimi
|
|
321 |
story_bytes: job.status === "completed" ? job.story_bytes : null
|
322 |
});
|
323 |
});
|
|
|
324 |
|
325 |
-
|
326 |
-
* @swagger
|
327 |
-
* /api/v1/user/info:
|
328 |
-
* get:
|
329 |
-
* summary: Telegram User Info
|
330 |
-
* tags: [User]
|
331 |
-
* parameters:
|
332 |
-
* - in: query
|
333 |
-
* name: user_id
|
334 |
-
* required: true
|
335 |
-
* description: null
|
336 |
-
* schema:
|
337 |
-
* type: string
|
338 |
-
* - in: header
|
339 |
-
* name: x-api-key
|
340 |
-
* required: true
|
341 |
-
* description: API key for authentication
|
342 |
-
* schema:
|
343 |
-
* type: string
|
344 |
-
* responses:
|
345 |
-
* 200:
|
346 |
-
* description: Success
|
347 |
-
*/
|
348 |
AntibanRoutes.get("/api/v1/user/info", authenticateApiKey, apiLimiter, async (req, res) => {
|
349 |
const userId = req.query.user_id;
|
350 |
if (!userId) {
|
@@ -358,7 +208,7 @@ AntibanRoutes.get("/api/v1/user/info", authenticateApiKey, apiLimiter, async (re
|
|
358 |
res.status(500).json({ error: "Failed to fetch user info" });
|
359 |
}
|
360 |
});
|
361 |
-
|
362 |
|
363 |
/**
|
364 |
* @swagger
|
|
|
94 |
}
|
95 |
}
|
96 |
|
97 |
+
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
AntibanRoutes.get("/api/v1/user/status/ban", authenticateApiKey, apiLimiter, async (req, res) => {
|
99 |
const Username = req.query.username;
|
100 |
if (!Username) {
|
|
|
107 |
res.status(500).json({ error: "Failed to fetch user info" });
|
108 |
}
|
109 |
});
|
110 |
+
*/
|
111 |
|
112 |
+
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
AntibanRoutes.get("/api/v1/user/author/admin", authenticateApiKey, apiLimiter, async (req, res) => {
|
114 |
const Username = req.query.username;
|
115 |
if (!Username) {
|
|
|
122 |
res.status(500).json({ error: "Failed to fetch user info" });
|
123 |
}
|
124 |
});
|
125 |
+
*/
|
126 |
|
127 |
+
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
AntibanRoutes.get("/api/v1/user/raw/getchat", authenticateApiKey, apiLimiter, async (req, res) => {
|
129 |
const Username = req.query.username;
|
130 |
if (!Username) {
|
|
|
137 |
res.status(500).json({ error: "Failed to fetch user info" });
|
138 |
}
|
139 |
});
|
140 |
+
*/
|
141 |
|
142 |
+
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
AntibanRoutes.get("/api/v1/user/story/task", authenticateApiKey, apiLimiter, async (req, res) => {
|
144 |
const Links = req.query.story_url;
|
145 |
if (!Links) {
|
|
|
165 |
|
166 |
res.json({ message: "Download started", status: "processing", job_id });
|
167 |
});
|
168 |
+
*/
|
169 |
|
170 |
+
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
AntibanRoutes.delete("/api/v1/user/story/task/:job_id", authenticateApiKey, apiLimiter, async (req, res) => {
|
172 |
const { job_id } = req.params;
|
173 |
|
|
|
178 |
}
|
179 |
res.json({ message: "Job deleted successfully", job_id });
|
180 |
});
|
181 |
+
*/
|
182 |
|
183 |
+
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
AntibanRoutes.get("/api/v1/user/story/task/:job_id", authenticateApiKey, apiLimiter, async (req, res) => {
|
185 |
const job = await Job.findOne({ job_id: req.params.job_id });
|
186 |
|
|
|
192 |
story_bytes: job.status === "completed" ? job.story_bytes : null
|
193 |
});
|
194 |
});
|
195 |
+
*/
|
196 |
|
197 |
+
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
AntibanRoutes.get("/api/v1/user/info", authenticateApiKey, apiLimiter, async (req, res) => {
|
199 |
const userId = req.query.user_id;
|
200 |
if (!userId) {
|
|
|
208 |
res.status(500).json({ error: "Failed to fetch user info" });
|
209 |
}
|
210 |
});
|
211 |
+
*/
|
212 |
|
213 |
/**
|
214 |
* @swagger
|