Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c448bba
Update types.py
coder2020official Apr 12, 2025
805c78f
Add business account methods
coder2020official Apr 12, 2025
1d32718
Added AcceptedGiftTypes and set_business_account_gift_settings
coder2020official Apr 12, 2025
3e0f06a
Add get_business_account_star_balance
coder2020official Apr 12, 2025
af858de
Added transfer_business_account_stars
coder2020official Apr 12, 2025
c012a59
Added get_business_account_gifts, OwnedGiftRegular, OwnedGiftUnique, …
coder2020official Apr 12, 2025
3d238a4
Added convert_gift_to_stars
coder2020official Apr 12, 2025
817f2ad
Added upgrade_gift and transfer_gift methods
coder2020official Apr 12, 2025
b47c73f
Added InputStoryContent
coder2020official Apr 12, 2025
1713909
Stories
coder2020official Apr 12, 2025
1c08163
posting, editing, deleting stories(needs testing)
coder2020official Apr 12, 2025
b05d209
Replaced the field can_send_gift with the field accepted_gift_types …
coder2020official Apr 12, 2025
6fedece
Added unique_gift and gift
coder2020official Apr 12, 2025
e3d7f96
Added gift_premium_subscription
coder2020official Apr 12, 2025
f76cac8
Added premium_subscription_duration to TransactionPartnerUser
coder2020official Apr 12, 2025
0bd9133
Added transaction_type to TransactionPartnerUser
coder2020official Apr 12, 2025
950d7c6
Added paid_message_price_changed
coder2020official Apr 12, 2025
9fb4fdd
Added paid_star_count
coder2020official Apr 12, 2025
0d1e515
Added set_business_account_profile_photo and remove_business_account_…
coder2020official Apr 12, 2025
d63b07a
Fix issues with posting stories
coder2020official Apr 13, 2025
49684b5
Fix stories for async
coder2020official Apr 13, 2025
533b52c
Fix issues related with Bot api 9.0
coder2020official Apr 19, 2025
d4f5ead
Fix typehints
coder2020official Apr 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions telebot/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,9 @@ class ChatFullInfo(JsonDeserializable):
:param can_send_gift: Optional. True, if gifts can be sent to the chat
:type can_send_gift: :obj:`bool`

:param accepted_gift_types: Information about types of gifts that are accepted by the chat or by the corresponding user for private chats
:type accepted_gift_types: :class:`telebot.types.AcceptedGiftTypes`

:param can_send_paid_media: Optional. True, if paid media messages can be sent or forwarded to the channel chat.
The field is available only for channel chats.
:type can_send_paid_media: :obj:`bool`
Expand Down Expand Up @@ -762,6 +765,8 @@ def de_json(cls, json_string):
obj['personal_chat'] = Chat.de_json(obj['personal_chat'])
if 'birthdate' in obj:
obj['birthdate'] = Birthdate.de_json(obj['birthdate'])
if 'accepted_gift_types' in obj:
obj['accepted_gift_types'] = AcceptedGiftTypes.de_json(obj['accepted_gift_types'])
return cls(**obj)

def __init__(self, id, type, title=None, username=None, first_name=None,
Expand All @@ -777,7 +782,8 @@ def __init__(self, id, type, title=None, username=None, first_name=None,
profile_background_custom_emoji_id=None, has_visible_history=None,
unrestrict_boost_count=None, custom_emoji_sticker_set_name=None, business_intro=None, business_location=None,
business_opening_hours=None, personal_chat=None, birthdate=None,
can_send_paid_media=None, can_send_gift=None, **kwargs):
can_send_paid_media=None,
accepted_gift_types=None, **kwargs):
self.id: int = id
self.type: str = type
self.title: Optional[str] = title
Expand Down Expand Up @@ -822,7 +828,11 @@ def __init__(self, id, type, title=None, username=None, first_name=None,
self.personal_chat: Optional[Chat] = personal_chat
self.birthdate: Optional[Birthdate] = birthdate
self.can_send_paid_media: Optional[bool] = can_send_paid_media
self.can_send_gift: Optional[bool] = can_send_gift
self.accepted_gift_types: AcceptedGiftTypes = accepted_gift_types
self.can_send_gift: Optional[bool] = None
if self.accepted_gift_types is not None: # not optional but still
# skip premium subscription?
self.can_send_gift: Optional[bool] = any([self.accepted_gift_types.unique_gifts, self.accepted_gift_types.unlimited_gifts, self.accepted_gift_types.limited_gifts])


class Chat(ChatFullInfo):
Expand Down