Skip to content

Conversation

@coder2020official
Copy link
Collaborator

@coder2020official coder2020official commented Dec 31, 2025

December 31, 2025
Bot API 9.3

Topics in private chats

Gifts

  • Added the methods getUserGifts and getChatGifts.
  • Replaced the field last_resale_star_count with the fields last_resale_currency and last_resale_amount in the class UniqueGiftInfo.
  • Replaced the parameter exclude_limited with the parameters exclude_limited_upgradable and exclude_limited_non_upgradable in the method getBusinessAccountGifts.
  • Added the value “gifted_upgrade” as a possible value of UniqueGiftInfo.origin for messages about the upgrade of a gift that was purchased after it was sent.
  • Added the value “offer” as a possible value of UniqueGiftInfo.origin for messages about the purchase of a gift through a purchase offer.
  • Added the field gift_upgrade_sent to the class Message.
  • Added the field gift_id to the class UniqueGift.
  • Added the field is_from_blockchain to the class UniqueGift.
  • Added the parameter exclude_from_blockchain in the method getBusinessAccountGifts, to filter out gifts that were assigned from the TON blockchain.
  • Added the fields personal_total_count and personal_remaining_count to the class Gift.
  • Added the field is_premium to the classes Gift and UniqueGift.
  • Added the field is_upgrade_separate to the classes GiftInfo and OwnedGiftRegular.
  • Added the class UniqueGiftColors that describes the color scheme for a user's name, replies to messages and link previews based on a unique gift.
  • Added the field has_colors to the class Gift.
  • Added the field colors to the class UniqueGift.
  • Added the class GiftBackground and the field background to the class Gift.
  • Added the field unique_gift_variant_count to the class Gift.
  • Added the field unique_gift_number to the classes GiftInfo and OwnedGiftRegular.
  • Added the field gifts_from_channels to the class AcceptedGiftTypes.

Miscellaneous

  • Allowed bots to disable their main username if they have additional active usernames purchased on Fragment.
  • Allowed bots to disable the right can_restrict_members in channel chats.
  • Added the method repostStory, allowing bots to repost stories across different business accounts they manage.
  • Added the class UserRating and the field rating to the class ChatFullInfo.
  • Increased the maximum price for paid media to 25000 Telegram Stars.
  • Added the field paid_message_star_count to the class ChatFullInfo.
  • Added the parameter message_effect_id to the methods forwardMessage and copyMessage.
  • Added the field unique_gift_colors to the class ChatFullInfo.
  • Added the field completed_by_chat to the class ChecklistTask.

…ed to determine whether forum topic mode is enabled for the bot in private chats.
…ass Message for messages in private chats with forum topic mode enabled.
…_currency and last_resale_amount in the class UniqueGiftInfo.
…mited_upgradable and exclude_limited_non_upgradable in the method getBusinessAccountGifts.
…o.origin for messages about the upgrade of a gift that was purchased after it was sent. Added the value “offer” as a possible value of UniqueGiftInfo.origin for messages about the purchase of a gift through a purchase offer.
…AccountGifts, to filter out gifts that were assigned from the TON blockchain.
…a user's name, replies to messages and link previews based on a unique gift.
…e field unique_gift_number to the classes GiftInfo and OwnedGiftRegular.
@coder2020official
Copy link
Collaborator Author

@Badiboy happy new year
finished I think, but messed up some stuff (need thorough review) and had to fix conflicts, hopefully nothing was impacted
skipped updating docstrings in places like 'supported ...'

@Badiboy
Copy link
Collaborator

Badiboy commented Jan 1, 2026

Got it... Will work on, but bot so fast.

:type message_id: :obj:`int`

:param message_thread_id: Optional. Unique identifier of a message thread to which the message belongs; for supergroups only
:param message_thread_id: Optional. Unique identifier of a message thread to which the message belongs; for supergroups and private chats only
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to process this parameter manually in de_json.

:type forward_origin: :class:`telebot.types.MessageOrigin`

:param is_topic_message: Optional. True, if the message is sent to a forum topic
:param is_topic_message: Optional. True, if the message is sent to a topic in a forum supergroup or a private chat with the bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to process this parameter manually in de_json.

payload['exclude_unique'] = exclude_unique
if sort_by_price is not None:
payload['sort_by_price'] = sort_by_price
if offset is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use an empty string to get the first chunk of results

I do not know how TG will process absence of this parameter. May be pass "" is offset is None?

payload['exclude_unique'] = exclude_unique
if sort_by_price is not None:
payload['sort_by_price'] = sort_by_price
if offset is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use an empty string to get the first chunk of results

I do not know how TG will process absence of this parameter. May be pass "" is offset is None?

if sort_by_price is not None:
payload['sort_by_price'] = sort_by_price
if offset is not None:
payload['offset'] = offset
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use an empty string to get the first chunk of results

I do not know how TG will process absence of this parameter. May be pass "" is offset is None?

telebot/types.py Outdated
obj['symbol'] = UniqueGiftSymbol.de_json(obj['symbol'])
obj['backdrop'] = UniqueGiftBackdrop.de_json(obj['backdrop'])
obj['gift_id'] = obj['gift_id']
if 'is_from_blockchain' in obj:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    if 'is_from_blockchain' in obj:
        obj['is_from_blockchain'] = obj['is_from_blockchain']

Don't need this.

telebot/types.py Outdated
if json_string is None: return None
obj = cls.check_json(json_string)
obj['sticker'] = Sticker.de_json(obj['sticker'])
if 'personal_total_count' in obj:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    if 'personal_total_count' in obj:
        obj['personal_total_count'] = obj['personal_total_count']
    if 'personal_remaining_count' in obj:
        obj['personal_remaining_count'] = obj['personal_remaining_count']

Don't need this.

telebot/types.py Outdated
if 'personal_remaining_count' in obj:
obj['personal_remaining_count'] = obj['personal_remaining_count']

if 'is_premium' in obj:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    if 'is_premium' in obj:
        obj['is_premium'] = obj['is_premium']

Don't need this.

telebot/types.py Outdated
obj['gift_id'] = obj['gift_id']
if 'is_from_blockchain' in obj:
obj['is_from_blockchain'] = obj['is_from_blockchain']
if 'is_premium' in obj:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    if 'is_premium' in obj:
        obj['is_premium'] = obj['is_premium']

Don't need this.

self.limited_gifts: bool = limited_gifts
self.unique_gifts: bool = unique_gifts
self.premium_subscription: bool = premium_subscription
def __init__(self, unlimited_gifts: Optional[bool]=None, limited_gifts: Optional[bool]=None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

They don't marked as OPTIONAL. New form of description, but not mentioned as optional there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't had an opportunity to test, but was cautious

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants