aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java
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/src/main/java
parent8f6ca84a9220433a67f55604dca1dd0d7dd49db6 (diff)
update dependencies
Diffstat (limited to 'juick-api/src/main/java')
-rw-r--r--juick-api/src/main/java/com/juick/api/TGBot.java6
1 files changed, 5 insertions, 1 deletions
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() {