nvd commited on
Update bot.py
Browse files
bot.py
CHANGED
|
@@ -355,15 +355,19 @@ async def handle_callback(callback: dict):
|
|
| 355 |
total_parts = math.ceil(upload_size / CHUNK_SIZE)
|
| 356 |
parts_sent = 0
|
| 357 |
for chunk_path, part_num, total in split_file(tmp_path, upload_filename, parts_dir):
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 367 |
result = await send_document_file(chat_id, chunk_path,
|
| 368 |
caption=caption,
|
| 369 |
display_filename=os.path.basename(chunk_path))
|
|
|
|
| 355 |
total_parts = math.ceil(upload_size / CHUNK_SIZE)
|
| 356 |
parts_sent = 0
|
| 357 |
for chunk_path, part_num, total in split_file(tmp_path, upload_filename, parts_dir):
|
| 358 |
+
# Safe base name for the command
|
| 359 |
+
combine_base = upload_filename if upload_filename else original_filename
|
| 360 |
+
|
| 361 |
+
caption = (
|
| 362 |
+
f"📦 Part {part_num}/{total} of `{combine_base}`\n"
|
| 363 |
+
f"Original file: `{original_filename}`\n\n"
|
| 364 |
+
"After downloading all parts:\n"
|
| 365 |
+
f"1. Open **Command Prompt (cmd)** in the folder with the parts.\n"
|
| 366 |
+
f"2. Run:\n"
|
| 367 |
+
f" `copy /b {combine_base}.part* {combine_base}`\n"
|
| 368 |
+
f" (Linux/Mac: `cat {combine_base}.part* > {combine_base}`)\n"
|
| 369 |
+
"3. Extract the combined file to get the original asset."
|
| 370 |
+
)
|
| 371 |
result = await send_document_file(chat_id, chunk_path,
|
| 372 |
caption=caption,
|
| 373 |
display_filename=os.path.basename(chunk_path))
|