Skip to content

Commit 950d7c6

Browse files
Added paid_message_price_changed
1 parent 0bd9133 commit 950d7c6

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

telebot/types.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,9 @@ class Message(JsonDeserializable):
11811181
:param giveaway_completed: Optional. Service message: giveaway completed, without public winners
11821182
:type giveaway_completed: :class:`telebot.types.GiveawayCompleted`
11831183

1184+
:param paid_message_price_changed: Optional. Service message: the price for paid messages has changed in the chat
1185+
:type paid_message_price_changed: :class:`telebot.types.PaidMessagePriceChanged`
1186+
11841187
:param video_chat_scheduled: Optional. Service message: video chat scheduled
11851188
:type video_chat_scheduled: :class:`telebot.types.VideoChatScheduled`
11861189

@@ -1443,6 +1446,9 @@ def de_json(cls, json_string):
14431446
if 'unique_gift' in obj:
14441447
opts['unique_gift'] = UniqueGiftInfo.de_json(obj['unique_gift'])
14451448
content_type = 'unique_gift'
1449+
if 'paid_message_price_changed' in obj:
1450+
opts['paid_message_price_changed'] = PaidMessagePriceChanged.de_json(obj['paid_message_price_changed'])
1451+
content_type = 'paid_message_price_changed'
14461452

14471453
return cls(message_id, from_user, date, chat, content_type, opts, json_string)
14481454

@@ -1563,6 +1569,7 @@ def __init__(self, message_id, from_user, date, chat, content_type, options, jso
15631569
self.message_auto_delete_timer_changed: Optional[MessageAutoDeleteTimerChanged] = None
15641570
self.gift : Optional[GiftInfo] = None
15651571
self.unique_gift : Optional[UniqueGiftInfo] = None
1572+
self.paid_message_price_changed: Optional[PaidMessagePriceChanged] = None
15661573

15671574

15681575
for key in options:
@@ -12292,4 +12299,25 @@ def de_json(cls, json_string):
1229212299
obj = cls.check_json(json_string)
1229312300
obj['gift'] = UniqueGift.de_json(obj['gift'])
1229412301
return cls(**obj)
12302+
12303+
12304+
class PaidMessagePriceChanged(JsonDeserializable):
12305+
"""
12306+
Describes a service message about a change in the price of paid messages within a chat.
12307+
12308+
Telegram documentation: https://core.telegram.org/bots/api#paidmessagepricechanged
12309+
12310+
:param paid_message_star_count: The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message
12311+
:type paid_message_star_count: :obj:`int`
12312+
12313+
:return: Instance of the class
12314+
:rtype: :class:`PaidMessagePriceChanged`
12315+
"""
12316+
def __init__(self, paid_message_star_count: int, **kwargs):
12317+
self.paid_message_star_count: int = paid_message_star_count
12318+
@classmethod
12319+
def de_json(cls, json_string):
12320+
if json_string is None: return None
12321+
obj = cls.check_json(json_string)
12322+
return cls(**obj)
1229512323

telebot/version.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)