BOT API v10.0#435
Open
mircoianese wants to merge 6 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the library to align with Telegram Bot API v10.0, adding new request/response types and model fields for guest mode, managed bot access settings, poll media enhancements, and live photo support, along with bumping the published version to 10.0.0.
Changes:
- Bump artifact/library version references to
10.0.0. - Add Guest Mode + managed bot access settings requests/responses/models.
- Add Live Photo support across requests/models/adapters and extend Polls with media-related fields/parameters.
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates dependency version examples to 10.0.0. |
| pom.xml | Bumps Maven project version to 10.0.0. |
| gradle.properties | Bumps Gradle VERSION_NAME to 10.0.0. |
| library/src/main/java/com/pengrad/telegrambot/utility/gson/PaidMediaTypeAdapter.java | Adds live_photo discriminator handling for paid media deserialization. |
| library/src/main/java/com/pengrad/telegrambot/utility/gson/OwnedGiftTypeAdapter.java | Removes unused paid media imports. |
| library/src/main/java/com/pengrad/telegrambot/response/SentGuestMessageResponse.kt | Adds response wrapper for guest query results. |
| library/src/main/java/com/pengrad/telegrambot/response/BotAccessSettingsResponse.kt | Adds response wrapper for managed bot access settings. |
| library/src/main/java/com/pengrad/telegrambot/request/SetManagedBotAccessSettings.kt | Adds request to set managed bot access settings. |
| library/src/main/java/com/pengrad/telegrambot/request/GetManagedBotAccessSettings.kt | Adds request to fetch managed bot access settings. |
| library/src/main/java/com/pengrad/telegrambot/request/GetUserPersonalChatMessages.kt | Adds request to fetch a user’s personal chat messages. |
| library/src/main/java/com/pengrad/telegrambot/request/AnswerGuestQuery.kt | Adds request to answer guest queries. |
| library/src/main/java/com/pengrad/telegrambot/request/SendPoll.kt | Adds new poll parameters (media/explanationMedia/membersOnly/countryCodes). |
| library/src/main/java/com/pengrad/telegrambot/request/SendLivePhoto.kt | Adds a new multipart request for sending live photos. |
| library/src/main/java/com/pengrad/telegrambot/request/GetChatAdministrators.java | Adds return_bots option. |
| library/src/main/java/com/pengrad/telegrambot/request/DeleteMessageReaction.kt | Adds request to delete a specific message reaction. |
| library/src/main/java/com/pengrad/telegrambot/request/DeleteAllMessageReactions.kt | Adds request to delete all message reactions. |
| library/src/main/java/com/pengrad/telegrambot/model/User.java | Adds supports_guest_queries field + accessor and equality/toString updates. |
| library/src/main/java/com/pengrad/telegrambot/model/Update.java | Adds guest_message field + accessor and equality/toString updates. |
| library/src/main/java/com/pengrad/telegrambot/model/Message.java | Adds live photo + guest query related fields and accessors. |
| library/src/main/java/com/pengrad/telegrambot/model/ExternalReplyInfo.java | Adds live photo field + accessor and equality/hash/toString updates. |
| library/src/main/java/com/pengrad/telegrambot/model/ChatPermissions.java | Adds can_react_to_messages field + accessor/builder and equality/hash/toString updates. |
| library/src/main/java/com/pengrad/telegrambot/model/ChatMember.java | Adds can_react_to_messages field + accessor and equality/hash/toString updates. |
| library/src/main/java/com/pengrad/telegrambot/model/SentGuestMessage.kt | Adds model for answerGuestQuery result payload. |
| library/src/main/java/com/pengrad/telegrambot/model/BotAccessSettings.kt | Adds model for managed bot access settings. |
| library/src/main/java/com/pengrad/telegrambot/model/Poll.java | Adds new poll fields (media/explanation_media/members_only/country_codes) + accessors and equality/toString updates. |
| library/src/main/java/com/pengrad/telegrambot/model/PollOption.java | Adds media to poll options + accessor and equality/hash/toString updates. |
| library/src/main/java/com/pengrad/telegrambot/model/PollMedia.kt | Adds model representing poll media payload. |
| library/src/main/java/com/pengrad/telegrambot/model/LivePhoto.kt | Adds model representing a live photo (photo array + video). |
| library/src/main/java/com/pengrad/telegrambot/model/paidmedia/PaidMediaLivePhoto.kt | Adds paid media live photo subtype model. |
| library/src/main/java/com/pengrad/telegrambot/model/request/InputPollMedia.kt | Adds marker interface for poll-level media inputs. |
| library/src/main/java/com/pengrad/telegrambot/model/request/InputPollOptionMedia.kt | Adds marker interface for poll-option media inputs. |
| library/src/main/java/com/pengrad/telegrambot/model/request/InputMedia.java | Makes input media usable as poll media/option media via marker interfaces. |
| library/src/main/java/com/pengrad/telegrambot/model/request/InputMediaLivePhoto.kt | Adds input media type for live photos. |
| library/src/main/java/com/pengrad/telegrambot/model/request/InputMediaLocation.kt | Adds location poll media input. |
| library/src/main/java/com/pengrad/telegrambot/model/request/InputMediaVenue.kt | Adds venue poll media input. |
| library/src/main/java/com/pengrad/telegrambot/model/request/InputMediaSticker.kt | Adds sticker input media type. |
| library/src/main/java/com/pengrad/telegrambot/model/request/InputPollOption.java | Adds media field/setter to poll options for sending. |
| library/src/main/java/com/pengrad/telegrambot/model/request/InputPaidMediaLivePhoto.kt | Adds paid-media input type for live photos. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
23
to
+27
| return context.deserialize(object, PaidMediaPhoto.class); | ||
| } else if (PaidMediaVideo.TYPE.equals(discriminator)) { | ||
| return context.deserialize(object, PaidMediaVideo.class); | ||
| } else if (PaidMediaLivePhoto.TYPE.equals(discriminator)) { | ||
| return context.deserialize(object, PaidMediaLivePhoto.class); |
Comment on lines
+136
to
+140
| var media: InputPollMedia? by optionalRequestParameter() | ||
| var explanationMedia: InputPollMedia? by optionalRequestParameter() | ||
| var membersOnly: Boolean? by optionalRequestParameter() | ||
| var countryCodes: List<String>? by optionalRequestParameter() | ||
|
|
Comment on lines
+9
to
+27
| class SendLivePhoto private constructor( | ||
| chatId: Long? = null, | ||
| channelUsername: String? = null, | ||
|
|
||
| livePhotoUrl: String? = null, | ||
| livePhotoFile: File? = null, | ||
| livePhotoBytes: ByteArray? = null, | ||
| ) : AbstractMultipartRequest<SendLivePhoto>( | ||
| chatId = chatId, | ||
| channelUsername = channelUsername, | ||
|
|
||
| contentParameterName = "live_photo", | ||
| contentUrl = livePhotoUrl, | ||
| contentFile = livePhotoFile, | ||
| contentBytes = livePhotoBytes, | ||
|
|
||
| defaultFileName = ContentTypes.PHOTO_FILE_NAME, | ||
| defaultContentType = ContentTypes.PHOTO_MIME_TYPE, | ||
| ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.