Skip to content

Commit 78316b2

Browse files
committed
Added the field can_send_paid_media to the class Chat.
1 parent 1936f09 commit 78316b2

File tree

1 file changed

+7
-0
lines changed
  • pyrogram/types/user_and_chats

1 file changed

+7
-0
lines changed

pyrogram/types/user_and_chats/chat.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ class Chat(Object):
117117
permissions (:obj:`~pyrogram.types.ChatPermissions` *optional*):
118118
Default chat member permissions, for groups and supergroups.
119119
120+
can_send_paid_media (``bool``, *optional*):
121+
True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats.
122+
120123
slowmode_next_send_date (:py:obj:`~datetime.datetime`, *optional*):
121124
Indicates when the user will be allowed to send another message in the chat. For supergroups only.
122125
@@ -268,6 +271,7 @@ def __init__(
268271
is_forum: bool = None,
269272
is_peak_preview: bool = None,
270273
max_reaction_count: int = None,
274+
can_send_paid_media: bool = None,
271275
_raw: Union[
272276
"raw.types.ChatInvite",
273277
"raw.types.Channel",
@@ -332,6 +336,7 @@ def __init__(
332336
self.business_opening_hours = business_opening_hours
333337
self.active_usernames = active_usernames
334338
self.max_reaction_count = max_reaction_count
339+
self.can_send_paid_media = can_send_paid_media
335340
self._raw = _raw
336341

337342
@staticmethod
@@ -599,6 +604,8 @@ async def _parse_full(client, chat_full: Union[raw.types.messages.ChatFull, raw.
599604
# TODO: Add EmojieStickerSet type
600605
parsed_chat.custom_emoji_sticker_set_name = getattr(full_chat.emojiset, "short_name", None)
601606

607+
parsed_chat.can_send_paid_media = getattr(full_chat, "paid_media_allowed", None)
608+
602609
parsed_chat.message_auto_delete_time = getattr(full_chat, "ttl_period")
603610

604611
if full_chat.pinned_msg_id:

0 commit comments

Comments
 (0)