1818
1919import os
2020import re
21- from typing import Union , BinaryIO
21+ from typing import Union , BinaryIO , List
2222
2323from pyrogram import StopTransmission
2424from pyrogram import raw
@@ -36,10 +36,12 @@ async def send_audio(
3636 audio : Union [str , BinaryIO ],
3737 caption : str = "" ,
3838 parse_mode : Union [str , None ] = object ,
39+ caption_entities : List ["types.MessageEntity" ] = None ,
3940 duration : int = 0 ,
4041 performer : str = None ,
4142 title : str = None ,
42- thumb : Union [str , BinaryIO ] = None , file_name : str = None ,
43+ thumb : Union [str , BinaryIO ] = None ,
44+ file_name : str = None ,
4345 disable_notification : bool = None ,
4446 reply_to_message_id : int = None ,
4547 schedule_date : int = None ,
@@ -79,6 +81,9 @@ async def send_audio(
7981 Pass "html" to enable HTML-style parsing only.
8082 Pass None to completely disable style parsing.
8183
84+ caption_entities (List of :obj:`~pyrogram.types.MessageEntity`):
85+ List of special entities that appear in the caption, which can be specified instead of __parse_mode__.
86+
8287 duration (``int``, *optional*):
8388 Duration of the audio in seconds.
8489
@@ -213,7 +218,7 @@ def progress(current, total):
213218 random_id = self .rnd_id (),
214219 schedule_date = schedule_date ,
215220 reply_markup = reply_markup .write () if reply_markup else None ,
216- ** await self . parser . parse ( caption , parse_mode )
221+ ** await utils . parse_text_entities ( self , caption , parse_mode , caption_entities )
217222 )
218223 )
219224 except FilePartMissing as e :
0 commit comments