diff options
Diffstat (limited to 'src/main/java/com/juick/server')
-rw-r--r-- | src/main/java/com/juick/server/TelegramBotManager.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main/java/com/juick/server/TelegramBotManager.java b/src/main/java/com/juick/server/TelegramBotManager.java index 518a7363..8a0c45dc 100644 --- a/src/main/java/com/juick/server/TelegramBotManager.java +++ b/src/main/java/com/juick/server/TelegramBotManager.java @@ -77,6 +77,8 @@ public class TelegramBotManager implements NotificationListener { private String apiUrl; @Value("${telegram_file_api_url:}") private String fileApiUrl; + @Value("${telegram_webhook_url:}") + private String webhookUrl; @Value("${telegram_token:12345678}") private String telegramToken; @Value("${telegram_debug:false}") @@ -98,15 +100,11 @@ public class TelegramBotManager implements NotificationListener { @PostConstruct public void init() { - if (StringUtils.isBlank(telegramToken)) { - logger.info("telegram token is not set, exiting"); - return; - } bot = new TelegramBot.Builder(telegramToken) .apiUrl(apiUrl).fileApiUrl(fileApiUrl).build(); if (!telegramDebug) { try { - SetWebhook webhook = new SetWebhook().url("https://api.juick.com/tlgmbtwbhk"); + SetWebhook webhook = new SetWebhook().url(webhookUrl); if (!bot.execute(webhook).isOk()) { logger.error("error setting webhook"); } |