rubenlagus / TelegramBots

Java library to create bots using Telegram Bots API
https://telegram.me/JavaBotsApi
MIT License
4.79k stars 1.23k forks source link

New reaction type breakes updates #1411

Closed AngryJKirk closed 3 months ago

AngryJKirk commented 3 months ago

New telegram update introduced a new reaction type and now the lib can not deserialize reactions if there are paid ones.


Caused by: com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id 'paid' as a subtype of org.telegram.telegrambots.meta.api.objects.reactions.ReactionType: known type ids = [custom_emoji, emoji] (for POJO property 'type')
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 2, column: 240] (through reference chain: org.telegram.telegrambots.meta.api.objects.ApiResponse["result"]->java.util.ArrayList[0]->org.telegram.telegrambots.meta.api.objects.Update["message_reaction_count"]->org.telegram.telegrambots.meta.api.objects.reactions.MessageReactionCountUpdated$MessageReactionCountUpdatedBuilderImpl["reactions"]->java.util.ArrayList[0]->org.telegram.telegrambots.meta.api.objects.reactions.ReactionCount$ReactionCountBuilderImpl["type"])
    at com.fasterxml.jackson.databind.exc.InvalidTypeIdException.from(InvalidTypeIdException.java:43)
    at com.fasterxml.jackson.databind.DeserializationContext.invalidTypeIdException(DeserializationContext.java:2040)
    at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownTypeId(DeserializationContext.java:1590)
    at com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase._handleUnknownTypeId(TypeDeserializerBase.java:298)
    at com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase._findDeserializer(TypeDeserializerBase.java:165)
    at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:151)
    at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:136)
    at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:263)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeSetAndReturn(MethodProperty.java:167)
    at com.fasterxml.jackson.databind.deser.BuilderBasedDeserializer.vanillaDeserialize(BuilderBasedDeserializer.java:294)
    at com.fasterxml.jackson.databind.deser.BuilderBasedDeserializer.deserialize(BuilderBasedDeserializer.java:218)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:361)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:246)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:30)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeSetAndReturn(MethodProperty.java:158)
    at com.fasterxml.jackson.databind.deser.BuilderBasedDeserializer.vanillaDeserialize(BuilderBasedDeserializer.java:294)
    at com.fasterxml.jackson.databind.deser.BuilderBasedDeserializer.deserialize(BuilderBasedDeserializer.java:218)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:310)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:361)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:246)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:30)
    at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:138)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:310)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177)
    at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:342)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4905)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3848)
    at org.telegram.telegrambots.meta.api.methods.botapimethods.PartialBotApiMethod.deserializeResponseInternal(PartialBotApiMethod.java:57)
    ... 10 common frames omitted
GitHubvuthamon commented 3 months ago

https://www.facebook.com/share/HG7GuKUSTrwRkecX/?mibextid=oFDknk

នៅ​ថ្ងៃទី សុក្រ 16 សីហា 2024, 3:46 AM Ruben Bermudez < @.***> បាន​សរសេរ​ថា៖

Closed #1411 https://github.com/rubenlagus/TelegramBots/issues/1411 as completed via #1414 https://github.com/rubenlagus/TelegramBots/pull/1414 .

— Reply to this email directly, view it on GitHub https://github.com/rubenlagus/TelegramBots/issues/1411#event-13902317462, or unsubscribe https://github.com/notifications/unsubscribe-auth/BKEUTWIF7WQUCP77GUE3SUDZRUHSFAVCNFSM6AAAAABMSPOLJOVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTHEYDEMZRG42DMMQ . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>

GitHubvuthamon commented 3 months ago

Have you smile smart

នៅ​ថ្ងៃទី សុក្រ 16 សីហា 2024, 7:44 AM Vutha Mon @.***> បាន​សរសេរ​ថា៖

https://www.facebook.com/share/HG7GuKUSTrwRkecX/?mibextid=oFDknk

នៅ​ថ្ងៃទី សុក្រ 16 សីហា 2024, 3:46 AM Ruben Bermudez < @.***> បាន​សរសេរ​ថា៖

Closed #1411 https://github.com/rubenlagus/TelegramBots/issues/1411 as completed via #1414 https://github.com/rubenlagus/TelegramBots/pull/1414.

— Reply to this email directly, view it on GitHub https://github.com/rubenlagus/TelegramBots/issues/1411#event-13902317462, or unsubscribe https://github.com/notifications/unsubscribe-auth/BKEUTWIF7WQUCP77GUE3SUDZRUHSFAVCNFSM6AAAAABMSPOLJOVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTHEYDEMZRG42DMMQ . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>