aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-12-01 20:43:47 +0300
committerGravatar Vitaly Takmazov2018-12-01 20:43:47 +0300
commite69f1c22ea693041929fd0e50881f75e1b12e050 (patch)
tree7662209b21cc72fa33b88fbd1a79c9ebc6f3596a /src/main/java/com
parent5d06aa2ca4d1dc0d304e98fef6ac6a9108e0db9f (diff)
Move telegram web hook url to config
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/juick/server/TelegramBotManager.java8
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");
}