Add missing caption_entities parameter to send_cached_media

This commit is contained in:
Dan 2020-12-05 01:34:14 +01:00
parent de0b215f8d
commit 6f878949e1

View File

@ -16,7 +16,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from typing import Union
from typing import Union, List
from pyrogram import raw
from pyrogram import types
@ -31,6 +31,7 @@ class SendCachedMedia(Scaffold):
file_id: str,
caption: str = "",
parse_mode: Union[str, None] = object,
caption_entities: List["types.MessageEntity"] = None,
disable_notification: bool = None,
reply_to_message_id: int = None,
schedule_date: int = None,
@ -67,6 +68,9 @@ class SendCachedMedia(Scaffold):
Pass "html" to enable HTML-style parsing only.
Pass None to completely disable style parsing.
caption_entities (List of :obj:`~pyrogram.types.MessageEntity`):
List of special entities that appear in the caption, which can be specified instead of __parse_mode__.
disable_notification (``bool``, *optional*):
Sends the message silently.
Users will receive a notification with no sound.
@ -99,7 +103,7 @@ class SendCachedMedia(Scaffold):
random_id=self.rnd_id(),
schedule_date=schedule_date,
reply_markup=reply_markup.write() if reply_markup else None,
**await self.parser.parse(caption, parse_mode)
**await utils.parse_text_entities(self, caption, parse_mode, caption_entities)
)
)