mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-04 16:38:49 +00:00
fix(channels): send telegram attachments with named file path
This commit is contained in:
parent
48f3cc6390
commit
e36e70fe16
@ -524,13 +524,15 @@ class TelegramChannel(BaseChannel):
|
||||
continue
|
||||
|
||||
media_bytes = Path(media_path).read_bytes()
|
||||
filename = Path(media_path).name
|
||||
send_kwargs = {param: media_bytes, "filename": filename}
|
||||
await self._call_with_retry(
|
||||
sender,
|
||||
chat_id=chat_id,
|
||||
**{param: media_bytes},
|
||||
reply_parameters=reply_params,
|
||||
**thread_kwargs,
|
||||
**extra,
|
||||
**send_kwargs,
|
||||
)
|
||||
except Exception as e:
|
||||
filename = media_path.rsplit("/", 1)[-1]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user