TelegramBots
TelegramBots copied to clipboard
File size now must be long
File size now must be long, after telegram premium is availible
I got the same problem:
2022-06-21 03:13:17,834 ERROR org.telegram.telegrambots.updatesreceivers.DefaultBotSession$ReaderThread [********Bot Telegram Connection] Unable to deserialize response org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException: Unable to deserialize response at org.telegram.telegrambots.meta.api.methods.updates.GetUpdates.deserializeResponse(GetUpdates.java:96) at org.telegram.telegrambots.updatesreceivers.DefaultBotSession$ReaderThread.getUpdatesFromServer(DefaultBotSession.java:260) at org.telegram.telegrambots.updatesreceivers.DefaultBotSession$ReaderThread.run(DefaultBotSession.java:189) Caused by: com.fasterxml.jackson.databind.JsonMappingException: Numeric value (2944520486) out of range of int (-2147483648 - 2147483647) at [Source: (StringReader); line: 2, column: 488] (through reference chain: org.telegram.telegrambots.meta.api.objects.ApiResponse["result"]->java.util.ArrayList[0]->org.telegram.telegrambots.meta.api.objects. Update["message"]->org.telegram.telegrambots.meta.api.objects.Message["document"]->org.telegram.telegrambots.meta.api.objects.Document["file_size"]) at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:397) at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:356) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.wrapAndThrow(BeanDeserializerBase.java:1726) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:295) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:156) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:293) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:156) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:293) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:156) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:290) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26) at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:138) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:293) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:156) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4526) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3468) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3451) at org.telegram.telegrambots.meta.api.methods.updates.GetUpdates.deserializeResponse(GetUpdates.java:88) ... 2 common frames omitted Caused by: com.fasterxml.jackson.core.exc.InputCoercionException: Numeric value (2944520486) out of range of int (-2147483648 - 2147483647) at [Source: (StringReader); line: 2, column: 488] at com.fasterxml.jackson.core.base.ParserMinimalBase._reportInputCoercion(ParserMinimalBase.java:596) at com.fasterxml.jackson.core.base.ParserMinimalBase.reportOverflowInt(ParserMinimalBase.java:565) at com.fasterxml.jackson.core.base.ParserBase.convertNumberToInt(ParserBase.java:889) at com.fasterxml.jackson.core.base.ParserBase._parseIntValue(ParserBase.java:802) at com.fasterxml.jackson.core.base.ParserBase.getIntValue(ParserBase.java:646) at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$IntegerDeserializer.deserialize(NumberDeserializers.java:477) at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$IntegerDeserializer.deserialize(NumberDeserializers.java:457) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:293) ... 19 common frames omitted
same poblem :(
"Long"-er number to be used? :) Numeric value (2944520486) out of range of int (-2147483648 - 2147483647)
Bot API 6.1
Telegram Premium • To support 4GB files uploaded by premium accounts (https://telegram.org/blog/700-million-and-premium#telegram-premium), file_size in most media classes can no longer be stored in a signed 32-bit integer type. • Bots can now distinguish premium Users (https://core.telegram.org/bots/api#user) and Stickers (https://core.telegram.org/bots/api#sticker) with the new respective fields is_premium and premium_animation.
Web Apps • Added several methods and fields to the class WebApp (https://core.telegram.org/bots/webapps#initializing-web-apps) to handle API version, additional colors, haptic feedback and more. • Added the events backButtonClicked, settingsButtonClicked and invoiceClosed. • Updated ThemeParams (https://core.telegram.org/bots/webapps#themeparams), MainButton (https://core.telegram.org/bots/webapps#mainbutton) and WebAppInitData (https://core.telegram.org/bots/webapps#webappinitdata) with new fields and methods.
Groups, Payments and Attachment Menu • Bots can now process join requests created without an invite link – they will still receive a chat_join_request update. • HTTP links for invoices can be generated with the new createInvoiceLink (https://core.telegram.org/bot/api#createinvoicelink) method. • Bots can now detect when a user added them to their attachment menu via the new added_to_attachment_menu field. Integrated bots can now also be used in groups, supergroups and channels.
• Check that your bot's webhook was set by you with the new secret_token (https://core.telegram.org/bots/api#setwebhook) parameter.
• And more, see the full changelog for details:
https://core.telegram.org/bots/api-changelog#june-20-2022
Warning: Only HTTPS links are now allowed in login_url.
Fixed in new version 6.1.0 - https://github.com/rubenlagus/TelegramBots/blob/master/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Document.java