From b7ffc5770411ea96081cf801dd1e2ffa5ea7c3f2 Mon Sep 17 00:00:00 2001 From: rubenlagus Date: Wed, 4 Nov 2020 15:17:27 +0000 Subject: [PATCH 1/8] Update link --- TelegramBots.wiki/Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TelegramBots.wiki/Changelog.md b/TelegramBots.wiki/Changelog.md index 2d9b6174..1b5dfaf1 100644 --- a/TelegramBots.wiki/Changelog.md +++ b/TelegramBots.wiki/Changelog.md @@ -1,5 +1,5 @@ ### 5.0.0 ### -1. Update Api version [5.0](https://core.telegram.org/bots/api-changelog#june-4-2020) +1. Update Api version [5.0](https://core.telegram.org/bots/api-changelog#november-4-2020) 2. Added Builders for many of the API methods and objects (hopefully all of them unless I missed something) 3. Some setters/getters may have change name. They no longer return a reference to itself, use Builder for that. 4. Simplified methods to set files in methods. Only InputFile is available now (this class contains constructors for all the cases) From b2fcbaa3c26c460f329c42fa81506dbfaddc7773 Mon Sep 17 00:00:00 2001 From: rubenlagus Date: Fri, 6 Nov 2020 01:16:06 +0000 Subject: [PATCH 2/8] Deprecate forgotten setter --- .../meta/api/methods/updatingmessages/EditMessageText.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageText.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageText.java index 850fa5a3..d29a01a6 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageText.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageText.java @@ -86,6 +86,10 @@ public class EditMessageText extends BotApiMethod { @JsonProperty(ENTITIES_FIELD) private List entities; ///< Optional. List of special entities that appear in message text, which can be specified instead of parse_mode + /** + * @deprecated Use {#setChatId(String)} + */ + @Deprecated public void setChatId(Long chatId) { this.chatId = chatId.toString(); } From bd2aa24e0057f6549a5dfaa0e02a516d1f22ffcd Mon Sep 17 00:00:00 2001 From: Victor Melnik Date: Sat, 7 Nov 2020 10:56:42 +0200 Subject: [PATCH 3/8] Fix FAQ.md according to API changes --- TelegramBots.wiki/FAQ.md | 89 ++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/TelegramBots.wiki/FAQ.md b/TelegramBots.wiki/FAQ.md index a54758e1..a296ec59 100644 --- a/TelegramBots.wiki/FAQ.md +++ b/TelegramBots.wiki/FAQ.md @@ -79,29 +79,29 @@ Quick example here that is showing ChactActions for commands like "/type" or "/r ```java if (update.hasMessage() && update.getMessage().hasText()) { - String text = update.getMessage().getText(); + String text = update.getMessage().getText(); - SendChatAction sendChatAction = new SendChatAction(); - sendChatAction.setChatId(update.getMessage().getChatId()); + SendChatAction sendChatAction = new SendChatAction(); + sendChatAction.setChatId(update.getMessage().getChatId()); - if (text.equals("/type")) { - // -> "typing" - sendChatAction.setAction(ActionType.TYPING); - // -> "recording a voice message" - } else if (text.equals("/record_audio")) { - sendChatAction.setAction(ActionType.RECORDAUDIO); - } else { - // -> more actions in the Enum ActionType - // For information: https://core.telegram.org/bots/api#sendchataction - sendChatAction.setAction(ActionType.UPLOADDOCUMENT); - } + if (text.equals("/type")) { + // -> "typing" + sendChatAction.setAction(ActionType.TYPING); + // -> "recording a voice message" + } else if (text.equals("/record_audio")) { + sendChatAction.setAction(ActionType.RECORDAUDIO); + } else { + // -> more actions in the Enum ActionType + // For information: https://core.telegram.org/bots/api#sendchataction + sendChatAction.setAction(ActionType.UPLOADDOCUMENT); + } - try { - Boolean wasSuccessfull = execute(sendChatAction); - } catch (TelegramApiException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + try { + Boolean wasSuccessfull = execute(sendChatAction); + } catch (TelegramApiException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } ``` @@ -116,7 +116,7 @@ There are several method to send a photo to an user using `sendPhoto` method: Wi // Set destination chat id sendPhotoRequest.setChatId(chatId); // Set the photo url as a simple photo - sendPhotoRequest.setPhoto(url); + sendPhotoRequest.setPhoto(new InputFile(url)); try { // Execute the method execute(sendPhotoRequest); @@ -131,7 +131,7 @@ There are several method to send a photo to an user using `sendPhoto` method: Wi // Set destination chat id sendPhotoRequest.setChatId(chatId); // Set the photo url as a simple photo - sendPhotoRequest.setPhoto(fileId); + sendPhotoRequest.setPhoto(new InputFile(fileId)); try { // Execute the method execute(sendPhotoRequest); @@ -145,8 +145,8 @@ There are several method to send a photo to an user using `sendPhoto` method: Wi SendPhoto sendPhotoRequest = new SendPhoto(); // Set destination chat id sendPhotoRequest.setChatId(chatId); - // Set the photo file as a new photo (You can also use InputStream with a method overload) - sendPhotoRequest.setNewPhoto(new File(filePath)); + // Set the photo file as a new photo (You can also use InputStream with a constructor overload) + sendPhotoRequest.setPhoto(new InputFile(new File(filePath))); try { // Execute the method execute(sendPhotoRequest); @@ -162,24 +162,23 @@ In this example we will check if user sends to bot a photo, if it is, get Photo' ```java // If it is a photo if (update.hasMessage() && update.getMessage().hasPhoto()) { - // Array with photos - List photos = update.getMessage().getPhoto(); - // Get largest photo's file_id - String f_id = photos.stream() - .sorted(Comparator.comparing(PhotoSize::getFileSize).reversed()) - .findFirst() - .orElse(null).getFileId(); - // Send photo by file_id we got before - SendPhoto msg = new SendPhoto() - .setChatId(update.getMessage().getChatId()) - .setPhoto(f_id) - .setCaption("Photo"); - try { - execute(msg); // Call method to send the photo - } catch (TelegramApiException e) { - e.printStackTrace(); - } - } + // Array with photos + List photos = update.getMessage().getPhoto(); + // Get largest photo's file_id + String f_id = photos.stream() + .max(Comparator.comparing(PhotoSize::getFileSize)) + .orElseThrow().getFileId(); + // Send photo by file_id we got before + SendPhoto msg = new SendPhoto() + .setChatId(update.getMessage().getChatId()) + .setPhoto(new InputFile(f_id)) + .setCaption("Photo"); + try { + execute(msg); // Call method to send the photo + } catch (TelegramApiException e) { + e.printStackTrace(); + } +} ``` ## How to use custom keyboards? ## @@ -264,9 +263,9 @@ Your main spring boot class should look like this: @SpringBootApplication public class YourApplicationMainClass { - public static void main(String[] args) { - SpringApplication.run(YourApplicationMainClass.class, args); - } + public static void main(String[] args) { + SpringApplication.run(YourApplicationMainClass.class, args); + } } ``` From c42955985ea229ab2488b8db047fac4fb18e849f Mon Sep 17 00:00:00 2001 From: Dhina17 Date: Sun, 8 Nov 2020 02:58:47 +0530 Subject: [PATCH 4/8] Fix unhandled exception type error in examples --- README.md | 2 +- TelegramBots.wiki/Getting-Started.md | 3 +-- TelegramBots.wiki/Using-Http-Proxy.md | 2 +- TelegramBots.wiki/abilities/Simple-Example.md | 6 +++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c7ddef60..1d7d44f1 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,8 @@ Once done, you just need to create a `org.telegram.telegrambots.meta.TelegramBot // Example taken from https://github.com/rubenlagus/TelegramBotsExample public class Main { public static void main(String[] args) { - TelegramBotsApi telegramBotsApi = new TelegramBotsApi(DefaultBotSession.class); try { + TelegramBotsApi telegramBotsApi = new TelegramBotsApi(DefaultBotSession.class); telegramBotsApi.registerBot(new ChannelHandlers()); telegramBotsApi.registerBot(new DirectionsHandlers()); telegramBotsApi.registerBot(new RaeHandlers()); diff --git a/TelegramBots.wiki/Getting-Started.md b/TelegramBots.wiki/Getting-Started.md index 53ffab72..ef710b88 100644 --- a/TelegramBots.wiki/Getting-Started.md +++ b/TelegramBots.wiki/Getting-Started.md @@ -135,9 +135,8 @@ Now that we have the library, we can start coding. There are few steps to follow public class Main { public static void main(String[] args) { - TelegramBotsApi botsApi = new TelegramBotsApi(); - try { + TelegramBotsApi botsApi = new TelegramBotsApi(DefaultBotSession.class); botsApi.registerBot(new MyAmazingBot()); } catch (TelegramApiException e) { e.printStackTrace(); diff --git a/TelegramBots.wiki/Using-Http-Proxy.md b/TelegramBots.wiki/Using-Http-Proxy.md index 2a44a9c2..ea0833d5 100644 --- a/TelegramBots.wiki/Using-Http-Proxy.md +++ b/TelegramBots.wiki/Using-Http-Proxy.md @@ -94,7 +94,7 @@ public class Main { }); // Create the TelegramBotsApi object to register your bots - TelegramBotsApi botsApi = new TelegramBotsApi(); + TelegramBotsApi botsApi = new TelegramBotsApi(DefaultBotSession.class); // Set up Http proxy DefaultBotOptions botOptions = new DefaultBotOptions(); diff --git a/TelegramBots.wiki/abilities/Simple-Example.md b/TelegramBots.wiki/abilities/Simple-Example.md index 7c3b7326..f8f549ac 100644 --- a/TelegramBots.wiki/abilities/Simple-Example.md +++ b/TelegramBots.wiki/abilities/Simple-Example.md @@ -81,10 +81,10 @@ Running the bot is just like running the regular Telegram bots. Create a Java cl ```java public class Application { public static void main(String[] args) { - // Create the TelegramBotsApi object to register your bots - TelegramBotsApi botsApi = new TelegramBotsApi(DefaultBotSession.class); - try { + // Create the TelegramBotsApi object to register your bots + TelegramBotsApi botsApi = new TelegramBotsApi(DefaultBotSession.class); + // Register your newly created AbilityBot botsApi.registerBot(new HelloBot()); } catch (TelegramApiException e) { From 88dd390566b05416912490d32bdaf15e24750b1e Mon Sep 17 00:00:00 2001 From: rubenlagus Date: Sun, 8 Nov 2020 11:28:57 +0000 Subject: [PATCH 5/8] Fix deserialization bug --- .../api/methods/commands/GetMyCommands.java | 4 +- .../meta/api/methods/updates/Close.java | 15 +++--- .../meta/api/methods/updates/LogOut.java | 11 ++--- .../meta/test/TestDeserialization.java | 48 +++++++++++++++++++ 4 files changed, 62 insertions(+), 16 deletions(-) diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/commands/GetMyCommands.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/commands/GetMyCommands.java index ea339716..4fb9c343 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/commands/GetMyCommands.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/commands/GetMyCommands.java @@ -1,10 +1,10 @@ package org.telegram.telegrambots.meta.api.methods.commands; import com.fasterxml.jackson.core.type.TypeReference; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; import org.telegram.telegrambots.meta.api.methods.BotApiMethod; @@ -27,7 +27,7 @@ import java.util.ArrayList; @Getter @Setter @ToString -@NoArgsConstructor +@AllArgsConstructor @Builder public class GetMyCommands extends BotApiMethod> { public static final String PATH = "getMyCommands"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updates/Close.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updates/Close.java index 0e40a1f1..73f461c4 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updates/Close.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updates/Close.java @@ -1,15 +1,14 @@ package org.telegram.telegrambots.meta.api.methods.updates; import com.fasterxml.jackson.core.type.TypeReference; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; import org.telegram.telegrambots.meta.api.methods.BotApiMethod; import org.telegram.telegrambots.meta.api.objects.ApiResponse; -import org.telegram.telegrambots.meta.api.objects.WebhookInfo; import org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException; import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; @@ -28,9 +27,9 @@ import java.io.IOException; @Getter @Setter @ToString -@NoArgsConstructor +@AllArgsConstructor @Builder -public class Close extends BotApiMethod { +public class Close extends BotApiMethod { public static final String PATH = "close"; @Override @@ -39,15 +38,15 @@ public class Close extends BotApiMethod { } @Override - public WebhookInfo deserializeResponse(String answer) throws TelegramApiRequestException { + public Boolean deserializeResponse(String answer) throws TelegramApiRequestException { try { - ApiResponse result = OBJECT_MAPPER.readValue(answer, - new TypeReference>() { + ApiResponse result = OBJECT_MAPPER.readValue(answer, + new TypeReference>() { }); if (result.getOk()) { return result.getResult(); } else { - throw new TelegramApiRequestException("Error logging out info", result); + throw new TelegramApiRequestException("Error closing", result); } } catch (IOException e2) { throw new TelegramApiRequestException("Unable to deserialize response", e2); diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updates/LogOut.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updates/LogOut.java index 5fa8dea4..bf549d1c 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updates/LogOut.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updates/LogOut.java @@ -9,7 +9,6 @@ import lombok.Setter; import lombok.ToString; import org.telegram.telegrambots.meta.api.methods.BotApiMethod; import org.telegram.telegrambots.meta.api.objects.ApiResponse; -import org.telegram.telegrambots.meta.api.objects.WebhookInfo; import org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException; import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; @@ -30,7 +29,7 @@ import java.io.IOException; @ToString @AllArgsConstructor @Builder -public class LogOut extends BotApiMethod { +public class LogOut extends BotApiMethod { public static final String PATH = "logOut"; @Override @@ -39,15 +38,15 @@ public class LogOut extends BotApiMethod { } @Override - public WebhookInfo deserializeResponse(String answer) throws TelegramApiRequestException { + public Boolean deserializeResponse(String answer) throws TelegramApiRequestException { try { - ApiResponse result = OBJECT_MAPPER.readValue(answer, - new TypeReference>() { + ApiResponse result = OBJECT_MAPPER.readValue(answer, + new TypeReference>() { }); if (result.getOk()) { return result.getResult(); } else { - throw new TelegramApiRequestException("Error logging out info", result); + throw new TelegramApiRequestException("Error logging out", result); } } catch (IOException e2) { throw new TelegramApiRequestException("Unable to deserialize response", e2); diff --git a/telegrambots-meta/src/test/java/org/telegram/telegrambots/meta/test/TestDeserialization.java b/telegrambots-meta/src/test/java/org/telegram/telegrambots/meta/test/TestDeserialization.java index 9c351069..aeb8b0e8 100644 --- a/telegrambots-meta/src/test/java/org/telegram/telegrambots/meta/test/TestDeserialization.java +++ b/telegrambots-meta/src/test/java/org/telegram/telegrambots/meta/test/TestDeserialization.java @@ -5,7 +5,10 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.telegram.telegrambots.meta.api.methods.commands.GetMyCommands; +import org.telegram.telegrambots.meta.api.methods.updates.Close; import org.telegram.telegrambots.meta.api.methods.updates.GetUpdates; +import org.telegram.telegrambots.meta.api.methods.updates.LogOut; import org.telegram.telegrambots.meta.api.objects.ApiResponse; import org.telegram.telegrambots.meta.api.objects.Audio; import org.telegram.telegrambots.meta.api.objects.CallbackQuery; @@ -17,6 +20,7 @@ import org.telegram.telegrambots.meta.api.objects.MessageEntity; import org.telegram.telegrambots.meta.api.objects.Update; import org.telegram.telegrambots.meta.api.objects.User; import org.telegram.telegrambots.meta.api.objects.Voice; +import org.telegram.telegrambots.meta.api.objects.commands.BotCommand; import org.telegram.telegrambots.meta.api.objects.inlinequery.ChosenInlineQuery; import org.telegram.telegrambots.meta.api.objects.inlinequery.InlineQuery; @@ -151,6 +155,50 @@ class TestDeserialization { } } + @Test + void TestDeserializationCloseMethod() throws Exception { + String updateText = "{\"ok\":true,\"result\": true}"; + + Boolean response = new Close().deserializeResponse(updateText); + + assertTrue(response); + } + + @Test + void TestDeserializationLogoutMethod() throws Exception { + String updateText = "{\"ok\":true,\"result\": true}"; + + Boolean response = new LogOut().deserializeResponse(updateText); + + assertTrue(response); + } + + @Test + void TestDeserializationGetMyCommandsMethod() throws Exception { + String updateText = "{\n" + + " \"ok\": true,\n" + + " \"result\": [\n" + + " {\n" + + " \"command\": \"enabled\",\n" + + " \"description\": \"Enabled Command\"\n" + + " },\n" + + " {\n" + + " \"command\": \"disabled\",\n" + + " \"description\": \"Disabled Command\"\n" + + " }\n" + + " ]\n" + + "}"; + + ArrayList response = new GetMyCommands().deserializeResponse(updateText); + + assertNotNull(response); + assertEquals(2, response.size()); + assertEquals("enabled", response.get(0).getCommand()); + assertEquals("Enabled Command", response.get(0).getDescription()); + assertEquals("disabled", response.get(1).getCommand()); + assertEquals("Disabled Command", response.get(1).getDescription()); + } + @Test void TestUpdateDeserialization() throws Exception { Update update = mapper.readValue(TelegramBotsHelper.GetUpdate(), Update.class); From f60425820a338972696d6057f2f827f96e3469dd Mon Sep 17 00:00:00 2001 From: rubenlagus Date: Sun, 8 Nov 2020 11:29:13 +0000 Subject: [PATCH 6/8] Fixed #794 --- .../telegram/telegrambots/meta/api/objects/ChatPermissions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatPermissions.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatPermissions.java index e75e9d66..40f52f2b 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatPermissions.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatPermissions.java @@ -37,7 +37,7 @@ public class ChatPermissions implements BotApiObject { @JsonProperty(CAN_SEND_MESSAGES_FIELD) private Boolean canSendMessages; ///< Optional. True, if the user is allowed to send text messages, contacts, locations and venues @JsonProperty(CAN_SEND_MEDIA_MESSAGES_FIELD) - private Boolean getCanSendMediaMessages; ///< Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages + private Boolean canSendMediaMessages; ///< Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages @JsonProperty(CAN_SEND_POLLS_FIELD) private Boolean canSendPolls; ///< Optional. True, if the user is allowed to send polls, implies can_send_messages @JsonProperty(CAN_SEND_OTHER_MESSAGES_FIELD) From 4af620770b399bb6156988f51765dd8aacf24d21 Mon Sep 17 00:00:00 2001 From: rubenlagus Date: Sun, 8 Nov 2020 11:35:09 +0000 Subject: [PATCH 7/8] Remove old method messed --- .../api/methods/updatingmessages/EditMessageText.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageText.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageText.java index d29a01a6..a268347a 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageText.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageText.java @@ -86,14 +86,6 @@ public class EditMessageText extends BotApiMethod { @JsonProperty(ENTITIES_FIELD) private List entities; ///< Optional. List of special entities that appear in message text, which can be specified instead of parse_mode - /** - * @deprecated Use {#setChatId(String)} - */ - @Deprecated - public void setChatId(Long chatId) { - this.chatId = chatId.toString(); - } - public void disableWebPagePreview() { disableWebPagePreview = true; } From 415d31eaec6cf1516545c6d6383365d6c97c4a22 Mon Sep 17 00:00:00 2001 From: rubenlagus Date: Sun, 8 Nov 2020 16:19:38 +0000 Subject: [PATCH 8/8] Updage 5.0.1 --- README.md | 8 ++++---- TelegramBots.wiki/Changelog.md | 6 ++++++ TelegramBots.wiki/Getting-Started.md | 4 ++-- TelegramBots.wiki/abilities/Simple-Example.md | 4 ++-- pom.xml | 2 +- telegrambots-abilities/README.md | 8 ++++---- telegrambots-abilities/pom.xml | 4 ++-- telegrambots-chat-session-bot/README.md | 2 +- telegrambots-chat-session-bot/pom.xml | 4 ++-- telegrambots-extensions/README.md | 4 ++-- telegrambots-extensions/pom.xml | 4 ++-- telegrambots-meta/pom.xml | 2 +- telegrambots-spring-boot-starter/README.md | 4 ++-- telegrambots-spring-boot-starter/pom.xml | 4 ++-- telegrambots/pom.xml | 4 ++-- 15 files changed, 35 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 1d7d44f1..abb79697 100644 --- a/README.md +++ b/README.md @@ -27,16 +27,16 @@ Just import add the library to your project with one of these options: org.telegram telegrambots - 5.0.0 + 5.0.1 ``` ```gradle - compile "org.telegram:telegrambots:5.0.0" + compile "org.telegram:telegrambots:5.0.1" ``` - 2. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/5.0.0) - 3. Download the jar(including all dependencies) from [here](https://mvnrepository.com/artifact/org.telegram/telegrambots/5.0.0) + 2. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/5.0.1) + 3. Download the jar(including all dependencies) from [here](https://mvnrepository.com/artifact/org.telegram/telegrambots/5.0.1) In order to use Long Polling mode, just create your own bot extending `org.telegram.telegrambots.bots.TelegramLongPollingBot`. diff --git a/TelegramBots.wiki/Changelog.md b/TelegramBots.wiki/Changelog.md index 1b5dfaf1..adb8a126 100644 --- a/TelegramBots.wiki/Changelog.md +++ b/TelegramBots.wiki/Changelog.md @@ -1,3 +1,9 @@ +### 5.0.1 ### +1. Fixing couple of bugs from 5.0.0 +2. Buf fixing: #794 +3. Docs updated to reflect usage for version 5.0.0 +4. EditMessageText setChatIId(Long) is removed to keep consistency + ### 5.0.0 ### 1. Update Api version [5.0](https://core.telegram.org/bots/api-changelog#november-4-2020) 2. Added Builders for many of the API methods and objects (hopefully all of them unless I missed something) diff --git a/TelegramBots.wiki/Getting-Started.md b/TelegramBots.wiki/Getting-Started.md index ef710b88..0c8907ca 100644 --- a/TelegramBots.wiki/Getting-Started.md +++ b/TelegramBots.wiki/Getting-Started.md @@ -11,13 +11,13 @@ First you need ot get the library and add it to your project. There are few poss org.telegram telegrambots - 5.0.0 + 5.0.1 ``` * With **Gradle**: ```groovy - compile group: 'org.telegram', name: 'telegrambots', version: '5.0.0' + compile group: 'org.telegram', name: 'telegrambots', version: '5.0.1' ``` 2. Don't like **Maven Central Repository**? It can also be taken from [Jitpack](https://jitpack.io/#rubenlagus/TelegramBots). diff --git a/TelegramBots.wiki/abilities/Simple-Example.md b/TelegramBots.wiki/abilities/Simple-Example.md index f8f549ac..ca569282 100644 --- a/TelegramBots.wiki/abilities/Simple-Example.md +++ b/TelegramBots.wiki/abilities/Simple-Example.md @@ -9,12 +9,12 @@ As with any Java project, you will need to set your dependencies. org.telegram telegrambots-abilities - 5.0.0 + 5.0.1 ``` * **Gradle** ```groovy - implementation group: 'org.telegram', name: 'telegrambots-abilities', version: '5.0.0' + implementation group: 'org.telegram', name: 'telegrambots-abilities', version: '5.0.1' ``` * [JitPack](https://jitpack.io/#rubenlagus/TelegramBots) diff --git a/pom.xml b/pom.xml index d96c1f85..08cae031 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots pom - 5.0.0 + 5.0.1 telegrambots diff --git a/telegrambots-abilities/README.md b/telegrambots-abilities/README.md index 6c58330e..52d18fe0 100644 --- a/telegrambots-abilities/README.md +++ b/telegrambots-abilities/README.md @@ -18,19 +18,19 @@ Usage org.telegram telegrambots-abilities - 5.0.0 + 5.0.1 ``` **Gradle** ```gradle - compile "org.telegram:telegrambots-abilities:5.0.0" + compile "org.telegram:telegrambots-abilities:5.0.1" ``` -**JitPack** - [JitPack](https://jitpack.io/#rubenlagus/TelegramBots/v5.0.0) +**JitPack** - [JitPack](https://jitpack.io/#rubenlagus/TelegramBots/v5.0.1) -**Plain imports** - [Here](https://github.com/rubenlagus/TelegramBots/releases/tag/v5.0.0) +**Plain imports** - [Here](https://github.com/rubenlagus/TelegramBots/releases/tag/v5.0.1) Motivation ---------- diff --git a/telegrambots-abilities/pom.xml b/telegrambots-abilities/pom.xml index 7d4b10fb..a5429c14 100644 --- a/telegrambots-abilities/pom.xml +++ b/telegrambots-abilities/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 5.0.0 + 5.0.1 telegrambots-abilities @@ -84,7 +84,7 @@ org.telegram telegrambots - 5.0.0 + 5.0.1 org.apache.commons diff --git a/telegrambots-chat-session-bot/README.md b/telegrambots-chat-session-bot/README.md index 5cfd0cf7..99446945 100644 --- a/telegrambots-chat-session-bot/README.md +++ b/telegrambots-chat-session-bot/README.md @@ -15,7 +15,7 @@ Usage org.telegram telegrambots-chat-session-bot - 5.0.0 + 5.0.1 ``` diff --git a/telegrambots-chat-session-bot/pom.xml b/telegrambots-chat-session-bot/pom.xml index 00b9368f..4d83e7e2 100644 --- a/telegrambots-chat-session-bot/pom.xml +++ b/telegrambots-chat-session-bot/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 5.0.0 + 5.0.1 telegrambots-chat-session-bot @@ -84,7 +84,7 @@ org.telegram telegrambots - 5.0.0 + 5.0.1 diff --git a/telegrambots-extensions/README.md b/telegrambots-extensions/README.md index e56cf766..5deffb45 100644 --- a/telegrambots-extensions/README.md +++ b/telegrambots-extensions/README.md @@ -16,12 +16,12 @@ Just import add the library to your project with one of these options: org.telegram telegrambotsextensions - 5.0.0 + 5.0.1 ``` 2. Using Gradle: ```gradle - compile "org.telegram:telegrambotsextensions:5.0.0" + compile "org.telegram:telegrambotsextensions:5.0.1" ``` \ No newline at end of file diff --git a/telegrambots-extensions/pom.xml b/telegrambots-extensions/pom.xml index 4dd00ed0..6e6fad0d 100644 --- a/telegrambots-extensions/pom.xml +++ b/telegrambots-extensions/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 5.0.0 + 5.0.1 telegrambotsextensions @@ -75,7 +75,7 @@ org.telegram telegrambots - 5.0.0 + 5.0.1 diff --git a/telegrambots-meta/pom.xml b/telegrambots-meta/pom.xml index c88a2c7c..e5b7595e 100644 --- a/telegrambots-meta/pom.xml +++ b/telegrambots-meta/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 5.0.0 + 5.0.1 telegrambots-meta diff --git a/telegrambots-spring-boot-starter/README.md b/telegrambots-spring-boot-starter/README.md index 1548f833..5501393d 100644 --- a/telegrambots-spring-boot-starter/README.md +++ b/telegrambots-spring-boot-starter/README.md @@ -18,14 +18,14 @@ Usage org.telegram telegrambots-spring-boot-starter - 5.0.0 + 5.0.1 ``` **Gradle** ```gradle - compile "org.telegram:telegrambots-spring-boot-starter:5.0.0" + compile "org.telegram:telegrambots-spring-boot-starter:5.0.1" ``` Motivation diff --git a/telegrambots-spring-boot-starter/pom.xml b/telegrambots-spring-boot-starter/pom.xml index 08f21a38..914e3e54 100644 --- a/telegrambots-spring-boot-starter/pom.xml +++ b/telegrambots-spring-boot-starter/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 5.0.0 + 5.0.1 telegrambots-spring-boot-starter @@ -70,7 +70,7 @@ UTF-8 UTF-8 - 5.0.0 + 5.0.1 2.3.5.RELEASE 3.18.0 diff --git a/telegrambots/pom.xml b/telegrambots/pom.xml index 7d5da3ac..37143391 100644 --- a/telegrambots/pom.xml +++ b/telegrambots/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 5.0.0 + 5.0.1 telegrambots @@ -92,7 +92,7 @@ org.telegram telegrambots-meta - 5.0.0 + 5.0.1 org.projectlombok