nvd commited on
Update bot.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
| 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)
|