Telegram Bots
New Version 10.1.0:
Api Version 10.1 & Bug Fixing
Documentation: https://rubenlagus.github.io/TelegramBotsDocumentation/telegram-bots.html
Changelog: https://github.com/rubenlagus/TelegramBots/releases/tag/v10.1.0
Has anyone upgraded to version 10.1?
After upgrading, my bot stopped receiving updates entirely whenever I manually send it a rich message. Restarting the bot didn’t help — it still receives nothing.
However, once I downgraded back to version 10.0, all the previously missing updates were suddenly delivered.
W Unfortunately, I couldn’t find any errors in the logs and the bot responds normally to all message types. However, the bot becomes completely unresponsive only when I send a rich message using “Article” or just by forwarding any rich messages to the bot. After that point, no updates at all reach my bot from TelegramApi Below are the dependencies in my pom.xml <dependency> <groupId>org.telegram</groupId> <artifactId>telegrambots-longpolling</artifactId> <version>10.1.0</version> </dependency> <dependency> <groupId>org.telegram</groupId> <artifactId>telegrambots-client</artifactId> <version>10.1.0</version> </dependency>W W Thanks! ✅ I've tested it with the dev branch. I tried to replicate the same scenarios and found no issues with the rich messages in version 10.1.1 I followed the git clone with checkout dev, then mvn install to the local Maven repo. Here is my pom.xml: <dependency> <groupId>org.telegram</groupId> <artifactId>telegrambots-longpolling</artifactId> <version>10.1.1</version> </dependency> <dependency> <groupId>org.telegram</groupId> <artifactId>telegrambots-client</artifactId> <version>10.1.1</version> </dependency>
Hello, got this bug
Bug: RichText cannot deserialize Bot API string/array wire forms — breaks getUpdates and rich editMessageText responses
Library: telegrambots-meta 10.1.0
API: Bot API 10.1 Rich Messages
Summary
Per Bot API RichText, a RichText value can be:
- a plain JSON string,
- a JSON array of RichText, or
- a typed object with a type discriminator (bold, italic, …).
In 10.1.0, RichText is modeled only as a polymorphic interface with @JsonTypeInfo / @JsonSubTypes for typed objects. There is no support for the string or array forms. That makes Jackson fail whenever Telegram returns a full Message.rich_message tree (which almost always contains plain strings and often arrays).
Impact
1. getUpdates stalls
After the bot sends or edits a rich message, the next update that includes that message (e.g. callback_query.message with rich_message) cannot be deserialized. Long polling retries forever on the same update:
Unable to deserialize response
Caused by: com.fasterxml.jackson.databind.JsonMappingException:
text is marked non-null but is null
... Message["rich_message"]->RichMessage["blocks"]->...
RichBlockSectionHeadingBuilder["text"]
Caused by: java.lang.NullPointerException: text is marked non-null but is null
at RichBlockSectionHeading$RichBlockSectionHeadingBuilder.text(...)
Root cause: Jackson tries to bind a JSON string into RichText via AsPropertyTypeDeserializer, fails, then Lombok @NonNull on the builder rejects null.
2. editMessageText with rich_message looks like an API failure
Telegram accepts the edit and returns ok: true with a Message containing rich_message. Client-side deserialization of that Message fails (deserializeResponseMessageOrBoolean then fails on Boolean as well), so callers see Unable to deserialize response even though the edit succeeded. Same issue can affect sendRichMessage response parsing.
Minimal reproduction (incoming update)
{
"ok": true,
"result": [{
"update_id": 1,
"callback_query": {
"id": "1",
S Thanks for the quick fix! I verified against dev / 10.1.1 locally (built from source and installed to local Maven). After upgrading from 10.1.0: getUpdates successfully deserializes updates that include callback_query.message.rich_message with plain-string and array RichText forms sendRichMessage and editMessageText with rich_message work correctly end-to-end (no more Unable to deserialize response / text is marked non-null but is null) The previous polling stall on rich-message callback updates is gone
Telegram Bots
Link
click to show
click to show
New Version 10.1.1:
Bug Fixing
Documentation: https://rubenlagus.github.io/TelegramBotsDocumentation/telegram-bots.html
Changelog: https://github.com/rubenlagus/TelegramBots/releases/tag/v10.1.1
Telegram Bots
Link
click to show
click to show
New Version 10.2.0:
Api Version 10.2
Documentation: https://rubenlagus.github.io/TelegramBotsDocumentation/telegram-bots.html
Changelog: https://github.com/rubenlagus/TelegramBots/releases/tag/v10.2.0