nvd commited on
Commit
84cfeba
Β·
verified Β·
1 Parent(s): 07a97fc

Update bot.py

Browse files
Files changed (1) hide show
  1. bot.py +5 -2
bot.py CHANGED
@@ -274,7 +274,7 @@ async def handle_callback(callback: dict):
274
  await send_message(chat_id, f"πŸ“₯ Downloaded {size_mb:.2f} MB – uploading to Bale...")
275
 
276
  # Upload with correct filename
277
- result = await send_document_file(chat_id, tmp_path, caption="Here you go!")
278
  if result.get("ok"):
279
  if status_message_id:
280
  await bale_request("deleteMessage", {
@@ -283,7 +283,10 @@ async def handle_callback(callback: dict):
283
  })
284
  await answer_callback(callback_id, "Sent!")
285
  else:
286
- await send_message(chat_id, f"❌ Upload failed: {result.get('description')}")
 
 
 
287
  await answer_callback(callback_id, "Failed to send.")
288
  except Exception as e:
289
  logger.error(f"❌ Download/Upload error: {e}", exc_info=True)
 
274
  await send_message(chat_id, f"πŸ“₯ Downloaded {size_mb:.2f} MB – uploading to Bale...")
275
 
276
  # Upload with correct filename
277
+ result = await send_document_file(chat_id, tmp_path, caption="Here you go!", display_filename=filename)
278
  if result.get("ok"):
279
  if status_message_id:
280
  await bale_request("deleteMessage", {
 
283
  })
284
  await answer_callback(callback_id, "Sent!")
285
  else:
286
+ # ──────────────────────────────────────────────
287
+ # πŸ‘‡ THIS IS THE NEW LINE – sends the full raw JSON to chat
288
+ # ──────────────────────────────────────────────
289
+ await send_message(chat_id, f"❌ Upload failed. Bale response:\n{result.get('description')}")
290
  await answer_callback(callback_id, "Failed to send.")
291
  except Exception as e:
292
  logger.error(f"❌ Download/Upload error: {e}", exc_info=True)