From 93106c8cfad86d6c3962373abb43b044560ba384 Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 12 Mar 2021 11:28:40 +0200 Subject: [PATCH 1/3] Fix typos --- .../api/methods/groupadministration/EditChatInviteLink.java | 2 +- .../api/methods/groupadministration/RevokeChatInviteLink.java | 2 +- .../java/org/telegram/telegrambots/bots/DefaultBotOptions.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/EditChatInviteLink.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/EditChatInviteLink.java index 86e8889b..18b617d6 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/EditChatInviteLink.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/EditChatInviteLink.java @@ -39,7 +39,7 @@ import java.io.IOException; @RequiredArgsConstructor @Builder public class EditChatInviteLink extends BotApiMethod { - public static final String PATH = "createChatInviteLink"; + public static final String PATH = "editChatInviteLink"; private static final String CHATID_FIELD = "chat_id"; private static final String INVITELINK_FIELD = "invite_link"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/RevokeChatInviteLink.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/RevokeChatInviteLink.java index f230421e..a70a2175 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/RevokeChatInviteLink.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/RevokeChatInviteLink.java @@ -39,7 +39,7 @@ import java.io.IOException; @AllArgsConstructor @Builder public class RevokeChatInviteLink extends BotApiMethod { - public static final String PATH = "createChatInviteLink"; + public static final String PATH = "revokeChatInviteLink"; private static final String CHATID_FIELD = "chat_id"; private static final String INVITELINK_FIELD = "invite_link"; diff --git a/telegrambots/src/main/java/org/telegram/telegrambots/bots/DefaultBotOptions.java b/telegrambots/src/main/java/org/telegram/telegrambots/bots/DefaultBotOptions.java index 2f59d7d2..6437d7c8 100644 --- a/telegrambots/src/main/java/org/telegram/telegrambots/bots/DefaultBotOptions.java +++ b/telegrambots/src/main/java/org/telegram/telegrambots/bots/DefaultBotOptions.java @@ -41,7 +41,7 @@ public class DefaultBotOptions implements BotOptions { baseUrl = ApiConstants.BASE_URL; httpContext = HttpClientContext.create(); proxyType = ProxyType.NO_PROXY; - getUpdatesLimit = ApiConstants.GETUPDATES_TIMEOUT; + getUpdatesTimeout = ApiConstants.GETUPDATES_TIMEOUT; getUpdatesLimit = 100; } From 87e3f23e8ed49ca5f790ecf6cdb0714d57bbdc2c Mon Sep 17 00:00:00 2001 From: Dmitry Gangan <42858651+dgangan@users.noreply.github.com> Date: Fri, 12 Mar 2021 22:08:18 +0200 Subject: [PATCH 2/3] Update Getting-Started.md In latest release of TelegramBots SendMessage class methods setChatId(String chatId) and setText(String text) are returning void - hence cannot be chained on SendMessage constructor Also, getChatId() is returning Long, rather than String, hence it should be converted to String while used in setChatId(String chatId) --- TelegramBots.wiki/Getting-Started.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/TelegramBots.wiki/Getting-Started.md b/TelegramBots.wiki/Getting-Started.md index 2759079a..21970470 100644 --- a/TelegramBots.wiki/Getting-Started.md +++ b/TelegramBots.wiki/Getting-Started.md @@ -84,9 +84,10 @@ Now that we have the library, we can start coding. There are few steps to follow public void onUpdateReceived(Update update) { // We check if the update has a message and the message has text if (update.hasMessage() && update.getMessage().hasText()) { - SendMessage message = new SendMessage() // Create a SendMessage object with mandatory fields - .setChatId(update.getMessage().getChatId()) - .setText(update.getMessage().getText()); + SendMessage message = new SendMessage(); // Create a SendMessage object with mandatory fields + message.setChatId(update.getMessage().getChatId().toString()); + message.setText(update.getMessage().getText()); + try { execute(message); // Call method to send the message } catch (TelegramApiException e) { From 6ce7eb13235ef68f879766f22dc03bb9a0016332 Mon Sep 17 00:00:00 2001 From: rubenlagus Date: Mon, 15 Mar 2021 01:38:52 +0000 Subject: [PATCH 3/3] Update 5.1.1 --- README.md | 8 ++++---- TelegramBots.wiki/Changelog.md | 3 +++ TelegramBots.wiki/Getting-Started.md | 4 ++-- TelegramBots.wiki/abilities/Simple-Example.md | 4 ++-- pom.xml | 2 +- telegrambots-abilities/README.md | 4 ++-- telegrambots-abilities/pom.xml | 4 ++-- telegrambots-chat-session-bot/README.md | 4 ++-- 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, 31 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index eac3ce7a..e40fa14d 100644 --- a/README.md +++ b/README.md @@ -27,18 +27,18 @@ Just import add the library to your project with one of these options: org.telegram telegrambots - 5.0.1 + 5.1.1 ``` 2. Using Gradle: ```gradle - implementation 'org.telegram:telegrambots:5.0.1' + implementation 'org.telegram:telegrambots:5.1.1' ``` - 3. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/5.0.1) - 4. Download the jar(including all dependencies) from [here](https://mvnrepository.com/artifact/org.telegram/telegrambots/5.0.1) + 3. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/5.1.1) + 4. Download the jar(including all dependencies) from [here](https://mvnrepository.com/artifact/org.telegram/telegrambots/5.1.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 14df1543..40f4336e 100644 --- a/TelegramBots.wiki/Changelog.md +++ b/TelegramBots.wiki/Changelog.md @@ -1,3 +1,6 @@ +### 5.1.1 ### +1. Bug fixing: #874 + ### 5.1.0 ### 1. Update Api version [5.1](https://core.telegram.org/bots/api-changelog#march-9-2021) 2. Bug fixing: #832, #841, #844, #851, #857 diff --git a/TelegramBots.wiki/Getting-Started.md b/TelegramBots.wiki/Getting-Started.md index 21970470..6551e769 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.1 + 5.1.1 ``` * With **Gradle**: ```gradle - implementation 'org.telegram:telegrambots:5.0.1' + implementation 'org.telegram:telegrambots:5.1.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 381bc03c..3f1ebfff 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.1 + 5.1.1 ``` * **Gradle** ```gradle - implementation 'org.telegram:telegrambots-abilities:5.0.1' + implementation 'org.telegram:telegrambots-abilities:5.1.1' ``` * [JitPack](https://jitpack.io/#rubenlagus/TelegramBots) diff --git a/pom.xml b/pom.xml index 617d75b7..4f48691c 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots pom - 5.1.0 + 5.1.1 telegrambots diff --git a/telegrambots-abilities/README.md b/telegrambots-abilities/README.md index e0a5ad4b..b3b67375 100644 --- a/telegrambots-abilities/README.md +++ b/telegrambots-abilities/README.md @@ -18,14 +18,14 @@ Usage org.telegram telegrambots-abilities - 5.0.1 + 5.1.1 ``` **Gradle** ```gradle - implementation 'org.telegram:telegrambots-abilities:5.0.1' + implementation 'org.telegram:telegrambots-abilities:5.1.1' ``` **JitPack** - [JitPack](https://jitpack.io/#rubenlagus/TelegramBots/v5.0.1) diff --git a/telegrambots-abilities/pom.xml b/telegrambots-abilities/pom.xml index 731661da..99945f87 100644 --- a/telegrambots-abilities/pom.xml +++ b/telegrambots-abilities/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 5.1.0 + 5.1.1 telegrambots-abilities @@ -84,7 +84,7 @@ org.telegram telegrambots - 5.1.0 + 5.1.1 org.apache.commons diff --git a/telegrambots-chat-session-bot/README.md b/telegrambots-chat-session-bot/README.md index 90071394..108d80dc 100644 --- a/telegrambots-chat-session-bot/README.md +++ b/telegrambots-chat-session-bot/README.md @@ -15,14 +15,14 @@ Usage org.telegram telegrambots-chat-session-bot - 5.0.1 + 5.1.1 ``` **Gradle** ```gradle - implementation 'org.telegram:telegrambots-chat-session-bot:5.0.1' + implementation 'org.telegram:telegrambots-chat-session-bot:5.1.1' ``` Motivation diff --git a/telegrambots-chat-session-bot/pom.xml b/telegrambots-chat-session-bot/pom.xml index 514ddc1d..30cd601a 100644 --- a/telegrambots-chat-session-bot/pom.xml +++ b/telegrambots-chat-session-bot/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 5.1.0 + 5.1.1 telegrambots-chat-session-bot @@ -84,7 +84,7 @@ org.telegram telegrambots - 5.1.0 + 5.1.1 diff --git a/telegrambots-extensions/README.md b/telegrambots-extensions/README.md index 36f1a19a..33f1642e 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.1 + 5.1.1 ``` 2. Using Gradle: ```gradle - implementation 'org.telegram:telegrambotsextensions:5.0.1' + implementation 'org.telegram:telegrambotsextensions:5.1.1' ``` \ No newline at end of file diff --git a/telegrambots-extensions/pom.xml b/telegrambots-extensions/pom.xml index 87388fc1..e35b6cae 100644 --- a/telegrambots-extensions/pom.xml +++ b/telegrambots-extensions/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 5.1.0 + 5.1.1 telegrambotsextensions @@ -75,7 +75,7 @@ org.telegram telegrambots - 5.1.0 + 5.1.1 diff --git a/telegrambots-meta/pom.xml b/telegrambots-meta/pom.xml index 3a1c883d..2e54389b 100644 --- a/telegrambots-meta/pom.xml +++ b/telegrambots-meta/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 5.1.0 + 5.1.1 telegrambots-meta diff --git a/telegrambots-spring-boot-starter/README.md b/telegrambots-spring-boot-starter/README.md index b5b02ef1..da25197c 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.1 + 5.1.1 ``` **Gradle** ```gradle - implementation 'org.telegram:telegrambots-spring-boot-starter:5.0.1' + implementation 'org.telegram:telegrambots-spring-boot-starter:5.1.1' ``` Motivation diff --git a/telegrambots-spring-boot-starter/pom.xml b/telegrambots-spring-boot-starter/pom.xml index f66b1a69..783b5d25 100644 --- a/telegrambots-spring-boot-starter/pom.xml +++ b/telegrambots-spring-boot-starter/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 5.1.0 + 5.1.1 telegrambots-spring-boot-starter @@ -70,7 +70,7 @@ UTF-8 UTF-8 - 5.1.0 + 5.1.1 2.4.3 1.6 diff --git a/telegrambots/pom.xml b/telegrambots/pom.xml index e49fbcc9..6b0569db 100644 --- a/telegrambots/pom.xml +++ b/telegrambots/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 5.1.0 + 5.1.1 telegrambots @@ -92,7 +92,7 @@ org.telegram telegrambots-meta - 5.1.0 + 5.1.1 org.projectlombok