mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-30 09:32:49 +00:00
Add business_connection_id parameter to send_paid_media method
This commit is contained in:
parent
00d1b532b8
commit
3351e00cdc
@ -477,9 +477,10 @@ class SendMediaGroup:
|
||||
|
||||
conn_id = None
|
||||
|
||||
for i in r.updates:
|
||||
if getattr(i, "connection_id", None):
|
||||
conn_id = i.connection_id
|
||||
for u in r.updates:
|
||||
if getattr(u, "connection_id", None):
|
||||
conn_id = u.connection_id
|
||||
break
|
||||
|
||||
|
||||
return await utils.parse_messages(
|
||||
|
@ -51,7 +51,8 @@ class SendPaidMedia:
|
||||
quote_offset: int = None,
|
||||
schedule_date: datetime = None,
|
||||
protect_content: bool = None,
|
||||
show_above_text: bool = None
|
||||
show_above_text: bool = None,
|
||||
business_connection_id: str = None
|
||||
) -> List["types.Message"]:
|
||||
"""Send a group or one paid photo/video.
|
||||
|
||||
@ -106,6 +107,9 @@ class SendPaidMedia:
|
||||
If True, link preview will be shown above the message text.
|
||||
Otherwise, the link preview will be shown below the message text.
|
||||
|
||||
business_connection_id (``str``, *optional*):
|
||||
Unique identifier of the business connection on behalf of which the message will be sent.
|
||||
|
||||
Returns:
|
||||
:obj:`~pyrogram.types.Message`: On success, the sent message is returned.
|
||||
|
||||
@ -264,8 +268,16 @@ class SendPaidMedia:
|
||||
**await utils.parse_text_entities(self, caption, parse_mode, caption_entities)
|
||||
),
|
||||
sleep_threshold=60,
|
||||
business_connection_id=business_connection_id
|
||||
)
|
||||
|
||||
conn_id = None
|
||||
|
||||
for u in r.updates:
|
||||
if getattr(u, "connection_id", None):
|
||||
conn_id = u.connection_id
|
||||
break
|
||||
|
||||
return await utils.parse_messages(
|
||||
self,
|
||||
raw.types.messages.Messages(
|
||||
@ -279,4 +291,5 @@ class SendPaidMedia:
|
||||
users=r.users,
|
||||
chats=r.chats
|
||||
),
|
||||
business_connection_id=conn_id
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user