diff --git a/mautrix_telegram/portal.py b/mautrix_telegram/portal.py index 2024c578..30611bab 100644 --- a/mautrix_telegram/portal.py +++ b/mautrix_telegram/portal.py @@ -600,8 +600,9 @@ class Portal: if "w" in info and "h" in info: attributes.append(DocumentAttributeImageSize(w=info["w"], h=info["h"])) - return await client.send_file(self.peer, file, mime, caption, attributes, - file_name, reply_to=reply_to) + return await client.send_file(self.peer, file, mime, caption=caption, + attributes=attributes, file_name=file_name, + reply_to=reply_to) async def handle_matrix_message(self, sender, message, event_id): client = sender.client if sender.logged_in else self.bot.client diff --git a/mautrix_telegram/tgclient.py b/mautrix_telegram/tgclient.py index a57f2504..64ec537e 100644 --- a/mautrix_telegram/tgclient.py +++ b/mautrix_telegram/tgclient.py @@ -67,7 +67,7 @@ class MautrixTelegramClient(TelegramClient): mime_type=mime_type or "application/octet-stream", attributes=list(attr_dict.values())) - request = SendMediaRequest(entity, media, message=caption, entities=entities, + request = SendMediaRequest(entity, media, message=caption or "", entities=entities or [], reply_to_msg_id=reply_to) return self._get_response_message(request, await self(request))