From 5d06aa2ca4d1dc0d304e98fef6ac6a9108e0db9f Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 1 Dec 2018 20:32:40 +0300 Subject: Telegram library from jitpack --- src/main/java/com/juick/server/TelegramBotManager.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/juick/server/TelegramBotManager.java b/src/main/java/com/juick/server/TelegramBotManager.java index 1836ffa9..518a7363 100644 --- a/src/main/java/com/juick/server/TelegramBotManager.java +++ b/src/main/java/com/juick/server/TelegramBotManager.java @@ -73,6 +73,10 @@ public class TelegramBotManager implements NotificationListener { private TelegramBot bot; + @Value("${telegram_api_url:}") + private String apiUrl; + @Value("${telegram_file_api_url:}") + private String fileApiUrl; @Value("${telegram_token:12345678}") private String telegramToken; @Value("${telegram_debug:false}") @@ -98,7 +102,8 @@ public class TelegramBotManager implements NotificationListener { logger.info("telegram token is not set, exiting"); return; } - bot = new TelegramBot(telegramToken); + bot = new TelegramBot.Builder(telegramToken) + .apiUrl(apiUrl).fileApiUrl(fileApiUrl).build(); if (!telegramDebug) { try { SetWebhook webhook = new SetWebhook().url("https://api.juick.com/tlgmbtwbhk"); -- cgit v1.2.3