Skip to content

Bot API 9.0 #2470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Apr 19, 2025
Merged

Bot API 9.0 #2470

merged 23 commits into from
Apr 19, 2025

Conversation

coder2020official
Copy link
Collaborator

@coder2020official coder2020official commented Apr 12, 2025

April 11, 2025
Bot API 9.0

Business Accounts

Mini Apps

  • Added the field DeviceStorage, allowing Mini Apps to use persistent local storage on the user's device.
  • Added the field SecureStorage, allowing Mini Apps to use a secure local storage on the user's device for sensitive data.

Gifts

Telegram Premium

  • Added the method giftPremiumSubscription, allowing bots to gift a user a Telegram Premium subscription paid in Telegram Stars.
  • Added the field premium_subscription_duration to the class TransactionPartnerUser for transactions involving a Telegram Premium subscription purchased by the bot.
  • Added the field transaction_type to the class TransactionPartnerUser, simplifying the differentiation and processing of all transaction types.

General

  • Increased the maximum price for paid media to 10000 Telegram Stars.
  • Increased the maximum price for a subscription period to 10000 Telegram Stars.
  • Added the class PaidMessagePriceChanged and the field paid_message_price_changed to the class Message, describing a service message about a price change for paid messages sent to the chat.
  • Added the field paid_star_count to the class Message, containing the number of Telegram Stars that were paid to send the message.

@coder2020official coder2020official marked this pull request as draft April 12, 2025 09:21
@coder2020official
Copy link
Collaborator Author

Skipped setting and removing profile photos for now

@coder2020official
Copy link
Collaborator Author

InputStoryContent might need more review / testing

@coder2020official
Copy link
Collaborator Author

Posting, editing, deleting stories will need testing

@coder2020official
Copy link
Collaborator Author

Done, but needs testing from my side too & careful review

@coder2020official coder2020official marked this pull request as ready for review April 13, 2025 16:18
@coder2020official
Copy link
Collaborator Author

@Badiboy I think I am done, but there may be parts where you will need to carefully review. E.g I have kind of tested posting stories, but areas in post_story did not work. Request seems fine to me, maybe I have passed wrong values.

I haven't contributed in a while so forgot some things, please check carefully and take your time

@Badiboy
Copy link
Collaborator

Badiboy commented Apr 13, 2025

Got it.

@Badiboy
Copy link
Collaborator

Badiboy commented Apr 19, 2025

Added the class InputProfilePhoto, describing a profile photo to be set.

Do not see this class.

@Badiboy
Copy link
Collaborator

Badiboy commented Apr 19, 2025

image

Mmmm... We forgot for contnent_type in all last updates? 😳

Upd. Not for all, but for:

  • refunded_payment
  • paid_media (not sure?!)

(We can make this update later, after merge this one)

@Badiboy
Copy link
Collaborator

Badiboy commented Apr 19, 2025

Update

  • update_types
  • content_type_service
  • content_type_media
    with all new (not only from this update)content_types that are not there.

(We can make this update later, after merge this one)

@Badiboy
Copy link
Collaborator

Badiboy commented Apr 19, 2025

I'm done. You made huge work.

@coder2020official
Copy link
Collaborator Author

I should be done for most, can you check my comments for unresolved suggestions

@coder2020official
Copy link
Collaborator Author

Also skipped content type media etc for now

telebot/types.py Outdated
@@ -11426,8 +11440,8 @@ class AcceptedGiftTypes(JsonDeserializable, JsonSerializable):
:return: Instance of the class
:rtype: :class:`AcceptedGiftTypes`
"""
def __init__(self, unlimited_gifts: Optional[bool] = None, limited_gifts: Optional[bool] = None,
unique_gifts: Optional[bool] = None, premium_subscription: Optional[bool] = None, **kwargs):
def __init__(self, unlimited_gifts: Optional[bool], limited_gifts: Optional[bool],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Optional[bool] => bool

telebot/types.py Outdated
def __init__(self, unlimited_gifts: Optional[bool] = None, limited_gifts: Optional[bool] = None,
unique_gifts: Optional[bool] = None, premium_subscription: Optional[bool] = None, **kwargs):
def __init__(self, unlimited_gifts: Optional[bool], limited_gifts: Optional[bool],
unique_gifts: Optional[bool], premium_subscription: Optional[bool], **kwargs):
self.unlimited_gifts: Optional[bool] = unlimited_gifts
Copy link
Collaborator

Choose a reason for hiding this comment

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

Optional[bool] => bool

@Badiboy
Copy link
Collaborator

Badiboy commented Apr 19, 2025

The last ) Then merge ))

@coder2020official
Copy link
Collaborator Author

Done I think, you can merge
Duration is 0-60 according to API; Apparently server recalculates duration anyways

@Badiboy Badiboy merged commit 19f12fc into eternnoir:master Apr 19, 2025
7 checks passed
@Badiboy
Copy link
Collaborator

Badiboy commented Apr 19, 2025

Good work!

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