From 9902baf9f1e830049b9fe461dceb1ef03f5fb45a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 24 Nov 2016 23:59:06 +0300 Subject: update dependencies --- juick-api/src/main/java/com/juick/api/TGBot.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'juick-api/src/main/java/com/juick') 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() { -- cgit v1.2.3