Skip to content

BOT API v10.0#435

Merged
pengrad merged 7 commits into
pengrad:masterfrom
mircoianese:api_10.0
May 29, 2026
Merged

BOT API v10.0#435
pengrad merged 7 commits into
pengrad:masterfrom
mircoianese:api_10.0

Conversation

@mircoianese
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 thread library/src/main/java/com/pengrad/telegrambot/request/DeleteMessageReaction.kt Outdated
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,
) {
@mircoianese mircoianese requested a review from pengrad May 27, 2026 19:15
Copy link
Copy Markdown
Owner

@pengrad pengrad left a comment

Choose a reason for hiding this comment

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

🔴 Real bugs

  1. LivePhoto model is wrong (line 2495).
    The spec says LivePhoto = photo? + file_id, file_unique_id, width, height, duration (required) + mime_type?, file_size?. The PR models it as {photo, video} — there is no video
    field, and all the file-identity/dimension fields are missing. Incoming LivePhoto objects (on Message, PollMedia, PaidMediaLivePhoto) will deserialize to almost nothing.

  2. DeleteMessageReaction signature is wrong (line 17057).
    Doc params: chat_id, message_id (required) + optional user_id, actor_chat_id. There is no reaction parameter at all. The PR takes a required type: ReactionType (serialized as
    type), which the API doesn't accept, and omits the real user_id/actor_chat_id.

  3. DeleteAllMessageReactions signature is wrong (line 17101).
    Doc params: chat_id (required) + optional user_id, actor_chat_id. There is no message_id — the method clears up to 10 000 reactions added by a given user/chat across the whole
    chat. The PR makes message_id required and omits user_id/actor_chat_id.

  4. sendLivePhoto is missing the required photo parameter (line 10463).
    The method requires two files: live_photo (the video) and photo (the static photo) — both Required. The PR's SendLivePhoto (via single-content AbstractMultipartRequest) only
    sends live_photo. The request can't be built correctly. Also, the URL constructors are dead weight: the doc states "Sending live photos by a URL is currently unsupported."

  5. InputMediaLivePhoto is missing the required photo field (line 8828).
    Doc: type, media (video), photo (static, required), plus caption fields (those are inherited from the InputMedia base, so OK). The PR adds only has_spoiler and the video; the
    required static photo is absent — so it's broken in sendMediaGroup/editMessageMedia too.

  6. InputPaidMediaLivePhoto is missing the required photo field (line 9170).
    Doc: type, media (video), photo (static). The PR sets only media.

Note for 4–6: the underlying gap is that the live-photo input types need to attach a second file (photo), which the current single-content multipart/InputMedia attachment machinery doesn't model. This needs real plumbing, not just a field.

@pengrad
Copy link
Copy Markdown
Owner

pengrad commented May 29, 2026

🟡 Minor

  • InputMedia implements both InputPollMedia and InputPollOptionMedia, but the spec defines two distinct unions (Sticker is option-media-only; Audio/Document are poll-media-only — lines 3046/3059). The marker approach is convenient but over-permissive at compile time. InputMediaLocation/Venue implementing both directly is correct.

@mircoianese
Copy link
Copy Markdown
Collaborator Author

Will AI replace us? Not yet...
Sorry, I didn’t check it enough.
Hope this time it’s better.

@pengrad pengrad merged commit b15bc2e into pengrad:master May 29, 2026
1 check failed
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.

3 participants