TelegramBots/TelegramBots.wiki/How-To-Update.md
2019-11-19 00:43:25 +00:00

2.8 KiB

To version 4.4.0.2

  1. Logging framework has been replaced by slf4j, so now you'll need to manage your own implementation.

To version 4.0.0

  1. Replace removed method from AbsSender with execute requests.
  2. Everything under "Telegrambots-meta" has been moved to package org.telegram.telegrambots.meta.
  3. close method has been removed from BotSession, use stop instead.
  4. All methods that are intended to upload files are using now InputMedia and InputFile.

To version 2.4.3

  1. Replace BotOptions by DefaultBotOptions.
  2. At the beginning of your program (before creating your TelegramBotsApi or Bot instance, add the following line:
    ApiContextInitializer.init();
    
  3. In SentCallback, update parameter types of onResult and onError. Inside those two method, you don't need to deserialize anything now, it comes already done.
  4. Deprecated (will be removed in next version):
    • org.telegram.telegrambots.bots.BotOptions. Use org.telegram.telegrambots.bots.DefaultBotOptions instead.
    • getPersonal from AnswerInlineQuery. Use isPersonal instead.
    • FILEBASEURL from File. Use getFileUrl instead.

To version 2.4.4

  1. Replace ReplyKeyboardHide by ReplyKeyboardRemove and its field hideKeyboard by removeKeyboard (remember getter and setters)
  2. Replace usage of edit_message by disable_edit_message (see this post)
  3. Removed deprecated stuff from version 2.4.3

To version 2.4.4.3

  1. Replace BotSession.close() by BotSession.stop().

To version 2.4.4.4

  1. All calls to editMessageText, editMessageCaption or editMessageReplyMarkup in AbsSender return value is changed to Serializable
  2. In editMessageTextAsync, editMessageCaptionAsync or editMessageReplyMarkupAsync in AbsSender, second parameter should become SentCallback<Serializable> due to new return type.

To version 3.0

  1. In Message object, field new_chat_member was replaced by new_chat_members that is now an array of users.

To version 3.0.2

  1. If you were using TelegramLongPollingCommandBot, add the new extensions dependency to your maven and fix import statements in your project.
  2. If you were using TelegramLongPollingCommandBot, make sure you start using constructors with username and prevent overriding getUsername method.

To version 3.2

  1. Replace usage of all deprecated methods from AbsSender with methods execute or executeAsync.
  2. If you are extending AbsSender class, implement new added methods.