fix(channels): send telegram attachments with named file path
This commit is contained in:
@@ -524,13 +524,15 @@ class TelegramChannel(BaseChannel):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
media_bytes = Path(media_path).read_bytes()
|
media_bytes = Path(media_path).read_bytes()
|
||||||
|
filename = Path(media_path).name
|
||||||
|
send_kwargs = {param: media_bytes, "filename": filename}
|
||||||
await self._call_with_retry(
|
await self._call_with_retry(
|
||||||
sender,
|
sender,
|
||||||
chat_id=chat_id,
|
chat_id=chat_id,
|
||||||
**{param: media_bytes},
|
|
||||||
reply_parameters=reply_params,
|
reply_parameters=reply_params,
|
||||||
**thread_kwargs,
|
**thread_kwargs,
|
||||||
**extra,
|
**extra,
|
||||||
|
**send_kwargs,
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
filename = media_path.rsplit("/", 1)[-1]
|
filename = media_path.rsplit("/", 1)[-1]
|
||||||
|
|||||||
Reference in New Issue
Block a user