Fix reuse of captions during send msg with file (#4500)

This commit is contained in:
Greg Eremeev
2024-10-25 18:27:58 -03:00
committed by GitHub
parent 85c4a91317
commit a77835a7d9
2 changed files with 46 additions and 0 deletions

View File

@@ -826,6 +826,9 @@ class MessageMethods:
await client.send_message(chat, 'Hi, future!', schedule=timedelta(minutes=5))
"""
if file is not None:
if isinstance(message, types.Message):
formatting_entities = formatting_entities or message.entities
message = message.message
return await self.send_file(
entity, file, caption=message, reply_to=reply_to,
attributes=attributes, parse_mode=parse_mode,