aboutsummaryrefslogtreecommitdiff
path: root/juick-api
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-11-24 23:59:06 +0300
committerGravatar Vitaly Takmazov2016-11-24 23:59:06 +0300
commit9902baf9f1e830049b9fe461dceb1ef03f5fb45a (patch)
tree6528adbc93ea752f9afc42f4aa21992b45ffea33 /juick-api
parent8f6ca84a9220433a67f55604dca1dd0d7dd49db6 (diff)
update dependencies
Diffstat (limited to 'juick-api')
-rw-r--r--juick-api/build.gradle2
-rw-r--r--juick-api/src/main/java/com/juick/api/TGBot.java6
2 files changed, 6 insertions, 2 deletions
diff --git a/juick-api/build.gradle b/juick-api/build.gradle
index 08991eed..382ea8bd 100644
--- a/juick-api/build.gradle
+++ b/juick-api/build.gradle
@@ -25,7 +25,7 @@ dependencies {
compile "org.springframework.security:spring-security-config:${springSecurityVersion}"
providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
- compile 'com.github.pengrad:java-telegram-bot-api:2.1.4'
+ compile 'com.github.pengrad:java-telegram-bot-api:2.3.0'
compile 'org.msbotframework4j:msbotframework4j-builder:0.1.4'
compile 'com.neovisionaries:nv-websocket-client:1.30'
compile 'net.coobird:thumbnailator:0.4.8'
diff --git a/juick-api/src/main/java/com/juick/api/TGBot.java b/juick-api/src/main/java/com/juick/api/TGBot.java
index 73aaa2b9..ae3c6b74 100644
--- a/juick-api/src/main/java/com/juick/api/TGBot.java
+++ b/juick-api/src/main/java/com/juick/api/TGBot.java
@@ -13,6 +13,7 @@ import com.pengrad.telegrambot.TelegramBotAdapter;
import com.pengrad.telegrambot.model.request.InlineKeyboardButton;
import com.pengrad.telegrambot.model.request.InlineKeyboardMarkup;
import com.pengrad.telegrambot.request.SendMessage;
+import com.pengrad.telegrambot.request.SetWebhook;
import com.pengrad.telegrambot.response.SendResponse;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
@@ -49,7 +50,10 @@ public class TGBot implements AutoCloseable {
}
bot = TelegramBotAdapter.build(token);
try {
- bot.setWebhook("https://api.juick.com/tlgmbtwbhk");
+ SetWebhook webhook = new SetWebhook().url("https://api.juick.com/tlgmbtwbhk");
+ if (!bot.execute(webhook).isOk()) {
+ logger.error("error setting webhook");
+ }
ws = new WebSocketFactory().createSocket("wss://ws.juick.com/");
ws.setPingInterval(60 * 1000);
ws.addListener(new WebSocketAdapter() {