Skip to content

Commit 6f88714

Browse files
Added the field is_paid_post to the class Message, which can be used to identify paid posts. Such posts must not be deleted for 24 hours to receive the payment.
1 parent 2400f25 commit 6f88714

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

telebot/types.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,10 @@ class Message(JsonDeserializable):
997997
as an away or a greeting business message, or as a scheduled message
998998
:type is_from_offline: :obj:`bool`
999999

1000+
:param is_paid_post: Optional. True, if the message is a paid post. Note that such posts must not be
1001+
deleted for 24 hours to receive the payment and can't be edited.
1002+
:type is_paid_post: :obj:`bool`
1003+
10001004
:param media_group_id: Optional. The unique identifier of a media message group this message belongs to
10011005
:type media_group_id: :obj:`str`
10021006

@@ -1504,6 +1508,8 @@ def de_json(cls, json_string):
15041508
opts['reply_to_checklist_task_id'] = obj['reply_to_checklist_task_id']
15051509
if 'direct_messages_topic' in obj:
15061510
opts['direct_messages_topic'] = DirectMessagesTopic.de_json(obj['direct_messages_topic'])
1511+
if 'is_paid_post' in obj:
1512+
opts['is_paid_post'] = obj['is_paid_post']
15071513

15081514
return cls(message_id, from_user, date, chat, content_type, opts, json_string)
15091515

@@ -1632,6 +1638,7 @@ def __init__(self, message_id, from_user, date, chat, content_type, options, jso
16321638
self.direct_message_price_changed: Optional[DirectMessagePriceChanged] = None
16331639
self.reply_to_checklist_task_id: Optional[int] = None
16341640
self.direct_messages_topic: Optional[DirectMessagesTopic] = None
1641+
self.is_paid_post: Optional[bool] = None
16351642

16361643
for key in options:
16371644
setattr(self, key, options[key])

0 commit comments

Comments
 (0)