soxogvv commited on
Commit
3cecbba
Β·
verified Β·
1 Parent(s): 75a85b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -8
app.py CHANGED
@@ -90,13 +90,6 @@ async def done_handler(event):
90
  await event.reply(f"βœ… Saved {inserted} new {ctx['mode']} link(s).")
91
  await check_and_alert(ctx["mode"], col)
92
 
93
- @bot.on(events.NewMessage(pattern="/cleanup"))
94
- async def cleanup_handler(event):
95
- if not is_owner(event): return
96
- raw_deleted = a_raw.delete_many({"used": True}).deleted_count
97
- reacted_deleted = a_reacted.delete_many({"used": True}).deleted_count
98
- await event.reply(f"πŸ—‘οΈ Deleted:\nRaw: {raw_deleted}\nReacted: {reacted_deleted}")
99
-
100
  @bot.on(events.NewMessage(func=lambda e: e.text and e.sender_id in user_context))
101
  async def link_collector(event):
102
  if not is_owner(event): return
@@ -249,7 +242,39 @@ async def process_correction(event):
249
  f"⏭ Skipped (already unused): {skipped}\n"
250
  f"❌ Not found in both: {not_found}"
251
  )
252
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  def run_flask():
254
  app.run(host="0.0.0.0", port=PORT)
255
 
 
90
  await event.reply(f"βœ… Saved {inserted} new {ctx['mode']} link(s).")
91
  await check_and_alert(ctx["mode"], col)
92
 
 
 
 
 
 
 
 
93
  @bot.on(events.NewMessage(func=lambda e: e.text and e.sender_id in user_context))
94
  async def link_collector(event):
95
  if not is_owner(event): return
 
242
  f"⏭ Skipped (already unused): {skipped}\n"
243
  f"❌ Not found in both: {not_found}"
244
  )
245
+ @bot.on(events.NewMessage(pattern="/help"))
246
+ async def help_handler(event):
247
+ if not is_owner(event): return
248
+ await event.reply(
249
+ "**πŸ€– Available Commands:**\n\n"
250
+ "**πŸ“Š Status & Counts**\n"
251
+ "`/start` β€” Show total raw/reacted links left\n"
252
+ "`/count` β€” Same as /start (alias)\n"
253
+ "`/status` β€” (Web endpoint) Get JSON of links left\n\n"
254
+
255
+ "**πŸ“₯ Add Links**\n"
256
+ "`/raw` β€” Start adding raw links\n"
257
+ "`/reacted` β€” Start adding reacted links\n"
258
+ "`/done` β€” Save links after sending\n\n"
259
+
260
+ "**πŸ›  Correct Used Flags**\n"
261
+ "`/cused` β€” Start correction for used links\n"
262
+ "`/dused` β€” Finalize correction and update DB\n\n"
263
+
264
+ "**πŸ’» File & Shell Tools**\n"
265
+ "`/bash <command>` β€” Run a terminal command\n"
266
+ "`/dl` β€” Download replied media\n"
267
+ "`/ul <filename>` β€” Upload a file from disk\n"
268
+ "`/doc <filename>` β€” Save replied text to file and upload\n\n"
269
+
270
+ "**ℹ️ Notes:**\n"
271
+ "- Only you (owner) can use these commands\n"
272
+ "- All links must start with `http`\n"
273
+ "- You can send multiple links in one message\n"
274
+ "- Correction only flips `used: True β†’ False`, not adding\n",
275
+ parse_mode='md'
276
+ )
277
+
278
  def run_flask():
279
  app.run(host="0.0.0.0", port=PORT)
280