Repository navigation
Commit 15ff4c4
Api Version 10.3 (#1606)
* fix(richtext): serialize RichTextPlain as a bare JSON string
The Bot API defines RichText as "either a String for plain text, an Array
of RichText, or any of the following types" - there is no "plain" type on
the wire. RichTextPlain exists only to give plain text a place in the Java
RichText hierarchy.
RichTextDeserializer already mapped a bare JSON string to RichTextPlain on
the way in, but nothing handled the way out: RichTextPlain had no custom
serializer, so Jackson wrote it as {"type":"plain","text":...}. Telegram
rejected such payloads with:
Bad Request: Can't parse PageBlockTableCell: Unsupported rich text type
Add RichTextPlainSerializer, mirroring the existing RichTextConcatSerializer
for the other library-only pseudo-type. It writes the bare string and
overrides serializeWithType so the @JsonTypeInfo machinery on the RichText
interface cannot re-wrap it in a type envelope.
Reading {"type":"plain",...} keeps working, so JSON persisted by the old
serializer still deserializes.
Fixes #1599
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Bug fixing v10.2.1
* feat(10.3): add EphemeralMessageParameters
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(replykeyboard): resolve ReplyKeyboard subtypes by marker key instead of deduction
Bot API 10.3 gives ReplyKeyboardMarkup a force_reply field, which makes
ForceReplyKeyboard's property set a subset of it. Jackson's Id.DEDUCTION then
cannot discriminate and, with defaultImpl = Void.class, returns null instead of
throwing.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(10.3): add DisabledButton, InlineKeyboardButton.disabled and force_reply
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(10.3): add RichMessageButton and RichTextButton
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(10.3): add buttons, expandable_blockquote and document rich blocks
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(10.3): add can_send_welcome_messages admin right
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(10.3): add CommunityChatJoined service message
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(10.3): add stopped_message_generation update
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(10.3): add text, entities and is_private to UniqueGiftInfo
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(client): send suggested_post_parameters as JSON, not toString()
addPart(String, Object) stringifies via value.toString(), so the nested object
was reaching the wire as Lombok's SuggestedPostParameters(price=..., ...).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(10.3)!: replace receiver_user_id/callback_query_id with ephemeral_message_parameters
The two flat parameters are kept as deprecated write-through accessors and
builder methods so 10.2 code still compiles; only the nested object is sent.
Also teaches telegrambots-abilities about the new stopped_message_generation
update, whose Update.has* method is enumerated reflectively by AbilityUtils.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(10.3): add rich_message to editEphemeralMessageText and show_caption_above_media to editEphemeralMessageCaption
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(10.3)!: support new file upload in editEphemeralMessageMedia
EditEphemeralMessageMedia becomes a PartialBotApiMethod<Boolean> so the media
can be sent as multipart, with matching client overloads in both client modules.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(10.3): add can_stop and keep_on_stop to the draft methods
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore: bump version to 10.3.0
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* build(surefire): run suffix-named *Test.java classes
The surefire <includes> block only listed **/Test*.java, so suffix-named
test classes were never executed by a normal build. Four files were dormant:
FlagTest 9 tests
AbilityUtilsTest 13 tests
UpdateTypeTest 24 tests
OkHttpFutureCallbackTest 1 test
All 47 pass once included.
The same block also nested <forkCount>0</forkCount> inside <includes>, where
Maven parsed it as an include pattern named "0" and ignored it. It is removed
rather than relocated: hoisting it to <configuration> actually applies it, and
in-process execution runs with the reactor root as the working directory, which
breaks TestPartialBotApiMethod because it resolves
src/test/resources/fixtures/... relatively. Dropping the line preserves the
forked default (forkCount=1) and keeps the module as the working directory.
Applying forkCount=0 requires fixing that relative path first.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* test(10.3): cover stopped-generation branches and is_compact serialization
Three code paths added for Bot API 10.3 had no test exercising them.
Flag.STOPPED_MESSAGE_GENERATION and the two AbilityUtils branches it feeds
(getChatId, and the getUser fall-through to EMPTY_USER) were only reachable
through the abilities module, which the plan's file map did not cover. Removing
either branch now fails the new tests with IllegalStateException rather than
passing silently.
InputRichBlockTable.isCompact was asserted only in the negative — omitted when
unset. It is an outbound object, so emitting "is_compact":true is the direction
that reaches Telegram; that is now asserted and round-tripped. The inbound
RichBlockTable case was already covered.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent b0edb54 commit 15ff4c4
90 files changed
Lines changed: 3306 additions & 219 deletions
File tree
- telegrambots-abilities
- src
- main/java/org/telegram/telegrambots/abilitybots/api
- objects
- util
- test/java/org/telegram/telegrambots/abilitybots/api
- objects
- util
- telegrambots-bom
- telegrambots-client-jetty-adapter
- src
- main/java/org/telegram/telegrambots/client
- jetty
- test/java/org/telegram/telegrambots/client
- telegrambots-client
- src
- main/java/org/telegram/telegrambots/client
- okhttp
- test/java/org/telegram/telegrambots/client
- telegrambots-extensions
- telegrambots-longpolling
- telegrambots-meta
- src
- main/java/org/telegram/telegrambots/meta
- api
- methods
- groupadministration
- send
- updates
- updatingmessages
- objects
- adminrights
- chatmember
- community
- ephemeral
- gifts
- message
- replykeyboard
- buttons
- richblock
- richtext
- generics
- test/java/org/telegram/telegrambots/meta/api
- methods
- send
- updatingmessages
- objects
- community
- ephemeral
- gifts
- replykeyboard
- richblock
- richtext
- telegrambots-springboot-longpolling-starter
- telegrambots-springboot-webhook-starter
- telegrambots-test-reports
- telegrambots-webhook
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
| 299 | + | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| |||
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
| 230 | + | |
| 231 | + | |
229 | 232 | | |
230 | 233 | | |
231 | 234 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
75 | 92 | | |
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
120 | 145 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
218 | 228 | | |
219 | 229 | | |
220 | 230 | | |
| |||
Lines changed: 29 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
632 | 633 | | |
633 | 634 | | |
634 | 635 | | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
635 | 662 | | |
636 | 663 | | |
637 | 664 | | |
| |||
712 | 739 | | |
713 | 740 | | |
714 | 741 | | |
715 | | - | |
| 742 | + | |
| 743 | + | |
716 | 744 | | |
717 | 745 | | |
718 | 746 | | |
| |||
0 commit comments