Update app.py
Browse files
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 |
|