nvd commited on
Commit
aedf640
·
verified ·
1 Parent(s): e7833ba

Update bot.py

Browse files
Files changed (1) hide show
  1. bot.py +13 -9
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
- caption = (
359
- f"📦 Part {part_num}/{total} of `{upload_filename}`\n"
360
- f"Original file: `{original_filename}`\n\n"
361
- "After downloading all parts:\n"
362
- f"1. Combine them into one file:\n"
363
- f" Windows: `copy /b *.part* {upload_filename}`\n"
364
- f" Linux/Mac: `cat *.part* > {upload_filename}`\n"
365
- "2. Extract the combined file (if it's a ZIP) to get the original asset."
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))