- Notifications
You must be signed in to change notification settings - Fork5.7k
Description
Important
- Comment here or in the dev group what you want to work on so we can assign you
- Please copy the relevant part of the checklist fromhttps://docs.python-telegram-bot.org/en/v21.7/contributing.html#check-list-for-prs to your PR and make sure to cover everything :)
- Please base your branch on theapi-8.0 branch
- If this is your first contribution, please be sure to read thecontribution guide and feel free to reach out with any questions viahttps://t.me/pythontelegrambotdev
Bot API 8.0
Bot API 8.0 introduces 10 powerful new features for Mini Apps - including the ability to enterfull-screen mode, launch fromhome screen shortcuts, offersubscription plans and more. Check out all the details in our dedicatedblog and Mini Appdocumentation.
Star Subscriptions
- Bots now support paid subscriptions powered byTelegram Stars - monetizing their efforts with multiple tiers of content and features.
- Added the parameter subscription_period to the methodcreateInvoiceLink to support the creation of links that are billed periodically.@Bibo-JoshiBot API 8.0: Add New Parameters to
create_invoice_link
#4568 - Added the parameter business_connection_id to the methodcreateInvoiceLink to support the creation of invoice links on behalf of business accounts.@Bibo-JoshiBot API 8.0: Add New Parameters to
create_invoice_link
#4568 - Added the fields subscription_expiration_date, is_recurring and is_first_recurring to the classSuccessfulPayment.Bot API 8.0: Add New Attributes to
SuccessfulPayment
#4570 - Added the methodeditUserStarSubscription.Bot API 8.0: Add
Bot.edit_user_star_subscription
#4571 - Added the field subscription_period to the classTransactionPartnerUser.@Bibo-JoshiBot API 8.0: Gifts #4576
Full-screen Mode
- Mini Apps are now able tobecome full-screen in both portrait and landscape mode - allowing them to host more games, play widescreen media and support immersive user experiences.
- Added the methods requestFullscreen and exitFullscreen to the classWebApp to toggle full-screen mode.
- Added the fields safeAreaInset and contentSafeAreaInset to the classWebApp, allowing Mini Apps to ensure that their content properly respects the device's safe area margins.
- Further added the fields isActive and isFullscreen to the classWebApp.
Added theevents activated, deactivated, safeAreaChanged, contentSafeAreaChanged, fullscreenChanged and fullscreenFailed for Mini Apps.
Homescreen Shortcuts
- Mini Apps can now be accessed viadirect shortcuts added to the home screen of mobile devices.
- Added the method addToHomeScreen to the classWebApp to create a shortcut for users to add to their home screens.
- Added the method checkHomeScreenStatus to the classWebApp to determine the status and support of the home screen shortcut for the Mini App on the current device.
- Added theevents homeScreenAdded and homeScreenChecked for Mini Apps.
Emoji Status
- Mini Apps can now prompt users to set theiremoji status - or request access to later sync it automatically with in-game badges, third-party APIs and more.
- Added the methodsetUserEmojiStatus. The user must allow the bot to manage their emoji status.Bot API 8.0: Add
Bot.set_user_emoji_status
#4572 - Added the method setEmojiStatus to the classWebApp to let users manually confirm a custom emoji as their new status via a native dialog.
- Added the method requestEmojiStatusAccess to the classWebApp for obtaining permission to later update a user's emoji status via the Bot API methodsetUserEmojiStatus.
- Added theevents emojiStatusSet, emojiStatusFailed and emojiStatusAccessRequested for Mini Apps.
Media Sharing and File Downloads
- Users can nowshare media directly from Mini Apps - sending referral codes, custom memes, artwork and more to any chat or posting themas a story.
- Added the classPreparedInlineMessage and the methodsavePreparedInlineMessage, allowing bots to suggest users to send a specific message from a Mini App via the methodshareMessage.@Bibo-JoshiBot API 8.0:
PreparedInlineMessage
andBot.save_prepared_inline_message
#4574 - Added the method shareMessage to the classWebApp to share media from Mini Apps to Telegram chats.
- Added the method downloadFile to the classWebApp, introducing support for a native popup that prompts users to download files from the Mini App.
- Added theevents shareMessageSent, shareMessageFailed and fileDownloadRequested for Mini Apps.
Geolocation Access
- Mini Apps can now requestgeolocation access to users, allowing them to build virtually any location-based service, from games with dynamic points of interest to interactive maps for events.
- Added the field LocationManager to the classWebApp.
- Added theevents locationManagerUpdated and locationRequested for Mini Apps.
Device Motion Tracking
- Mini Apps can now track detaileddevice motion data, allowing them to implement better productivity tools, immersive VR experiences and more.
- Added the fields isOrientationLocked, Accelerometer, DeviceOrientation and Gyroscope to the classWebApp.
- Added the methods lockOrientation and unlockOrientation to the classWebApp to control the screen orientation.
- Added theevents accelerometerStarted, accelerometerStopped, accelerometerChanged, accelerometerFailed, deviceOrientationStarted, deviceOrientationStopped, deviceOrientationChanged, deviceOrientationFailed, gyroscopeStarted, gyroscopeStopped, gyroscopeChanged, gyroscopeFailed for Mini Apps.
Gifts
- Bots can now sendPaid Gifts to users in exchange for Telegram Stars.
- Added the classesGift andGifts and the methodgetAvailableGifts, allowing bots to get all gifts available for sending.@Bibo-JoshiBot API 8.0: Gifts #4576
- Added the methodsendGift, allowing bots to send gifts to users.@Bibo-JoshiBot API 8.0: Gifts #4576
- Added the field gift to the classTransactionPartnerUser.@Bibo-JoshiBot API 8.0: Gifts #4576
Loading Screen Customization
- Mini Apps can customize their loading screen, adding their own icon and specific colors for light and dark themes.
- You can access these customization settings in@BotFather via /mybots > Select Bot > Bot Settings > Configure Mini App > Enable Mini App
Hardware-specific Optimizations
- Mini Apps running on Android can now receivebasic information about a device's processing hardware, allowing them to optimize user experience based on the device's capabilities.
- This information includes the OS, App and SDK's respective versions as well as the device's model and performance class.
General
- Added the field photo_url to the classWebAppUser for all bots, allowing Mini Apps to access a user's profile photo if their privacy settings allow for it.
- Third parties (e.g., Mini App builders) that receive or process data on behalf of Mini Apps are now able tovalidate it without knowing the App'sbot token.
- Debuggingoptions have been expanded to include full support for iOS devices. You can use these tools to find app-specific issues in your Mini App.