From 7a35fb0ee839bf20afdebd7cbc45c19f40775b9a Mon Sep 17 00:00:00 2001 From: azhohov Date: Sat, 22 Apr 2017 00:45:26 +0300 Subject: [PATCH 1/4] fix NPE --- .../java/org/telegram/telegrambots/api/objects/Message.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java index 1c90f1c4..96821997 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java @@ -183,7 +183,9 @@ public class Message implements BotApiObject { } public List getEntities() { - entities.forEach(x -> x.computeText(text)); + if (entities != null) { + entities.forEach(x -> x.computeText(text)); + } return entities; } From 73958b06e46463172eb577802d2c16f5f11e2e21 Mon Sep 17 00:00:00 2001 From: Ruben Bermudez Date: Mon, 29 May 2017 00:31:24 +0200 Subject: [PATCH 2/4] Fix bug when setting webhook --- .../java/org/telegram/telegrambots/bots/TelegramWebhookBot.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegrambots/src/main/java/org/telegram/telegrambots/bots/TelegramWebhookBot.java b/telegrambots/src/main/java/org/telegram/telegrambots/bots/TelegramWebhookBot.java index 5bc48bf0..bc07b96f 100644 --- a/telegrambots/src/main/java/org/telegram/telegrambots/bots/TelegramWebhookBot.java +++ b/telegrambots/src/main/java/org/telegram/telegrambots/bots/TelegramWebhookBot.java @@ -45,7 +45,7 @@ public abstract class TelegramWebhookBot extends DefaultAbsSender implements Web @Override public void setWebhook(String url, String publicCertificatePath) throws TelegramApiRequestException { try (CloseableHttpClient httpclient = HttpClientBuilder.create().setSSLHostnameVerifier(new NoopHostnameVerifier()).build()) { - String requestUrl = getBaseUrl() + getBotToken() + "/" + SetWebhook.PATH; + String requestUrl = getBaseUrl() + SetWebhook.PATH; HttpPost httppost = new HttpPost(requestUrl); httppost.setConfig(botOptions.getRequestConfig()); From f427662777a8b04dfebf64096504713812b30190 Mon Sep 17 00:00:00 2001 From: Ruben Bermudez Date: Mon, 29 May 2017 00:32:09 +0200 Subject: [PATCH 3/4] Merges #233 --- .../java/org/telegram/telegrambots/logging/BotLogger.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/logging/BotLogger.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/logging/BotLogger.java index 681c43bc..864dff64 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/logging/BotLogger.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/logging/BotLogger.java @@ -17,6 +17,10 @@ public class BotLogger { logger.setLevel(level); } + public static Level getLevel() { + return logger.getLevel(); + } + public static void registerLogger(Handler handler) { logger.addHandler(handler); } From 0312a3bcb126eaeac41607ab60bf074179ae69cf Mon Sep 17 00:00:00 2001 From: Ruben Bermudez Date: Mon, 29 May 2017 00:38:00 +0200 Subject: [PATCH 4/4] Version 3.0.1 --- README.md | 8 ++++---- TelegramBots.wiki/Changelog.md | 7 ++++++- TelegramBots.wiki/Getting-Started.md | 4 ++-- pom.xml | 4 ++-- telegrambots-meta/pom.xml | 2 +- telegrambots/pom.xml | 4 ++-- 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d0a461b5..91d6639c 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 - 3.0 + 3.0.1 ``` ```gradle - compile "org.telegram:telegrambots:3.0" + compile "org.telegram:telegrambots:3.0.1" ``` - 2. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/3.0) - 3. Download the jar(including all dependencies) from [here](https://github.com/rubenlagus/TelegramBots/releases/tag/3.0) + 2. Using Jitpack from [here](https://jitpack.io/#rubenlagus/TelegramBots/3.0.1) + 3. Download the jar(including all dependencies) from [here](https://github.com/rubenlagus/TelegramBots/releases/tag/3.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 a43ee378..c7f54bda 100644 --- a/TelegramBots.wiki/Changelog.md +++ b/TelegramBots.wiki/Changelog.md @@ -53,4 +53,9 @@ 6. New Payments API methods 7. New Video Messages API methods -**[[How to update to version 3.0|How-To-Update#3.0]]** \ No newline at end of file +**[[How to update to version 3.0|How-To-Update#3.0]]** + +### 3.0.1 ### +1. Added `getLevel` to `BotLogger` class. +2. Fix wrong URL when setting webhook +3. Bug Fixing: #244, #233 \ No newline at end of file diff --git a/TelegramBots.wiki/Getting-Started.md b/TelegramBots.wiki/Getting-Started.md index 6ea24081..8e503c51 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 - 3.0 + 3.0.1 ``` * With **Gradle**: ```groovy - compile group: 'org.telegram', name: 'telegrambots', version: '3.0' + compile group: 'org.telegram', name: 'telegrambots', version: '3.0.1' ``` 2. Don't like **Maven Central Repository**? It can also be taken from [Jitpack](https://jitpack.io/#rubenlagus/TelegramBots). diff --git a/pom.xml b/pom.xml index dc520f80..63fb8465 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots pom - 3.0 + 3.0.1 telegrambots @@ -24,6 +24,6 @@ true - 3.0 + 3.0.1 \ No newline at end of file diff --git a/telegrambots-meta/pom.xml b/telegrambots-meta/pom.xml index 1163305c..0993a01c 100644 --- a/telegrambots-meta/pom.xml +++ b/telegrambots-meta/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.telegram telegrambots-meta - 3.0 + 3.0.1 jar Telegram Bots Meta diff --git a/telegrambots/pom.xml b/telegrambots/pom.xml index 2c082c19..b38fc101 100644 --- a/telegrambots/pom.xml +++ b/telegrambots/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.telegram telegrambots - 3.0 + 3.0.1 jar Telegram Bots @@ -66,7 +66,7 @@ 2.8.7 2.8.0 2.5 - 3.0 + 3.0.1