diff options
author | Vitaly Takmazov | 2018-06-14 15:04:16 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-06-14 15:04:16 +0300 |
commit | ca37c96de0f2a5beb097f560949ecfaeb7a86880 (patch) | |
tree | 3f4b54e26450f6f65bebdfd8f3caa8160f138484 /juick-server/src/main/java/com/juick/server/api/webhooks | |
parent | 2236eee046e3ce304a3adcd9305ae6d6d2555003 (diff) |
Do not initialize telegram bot when token is missing
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/api/webhooks')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/api/webhooks/TelegramWebhook.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/webhooks/TelegramWebhook.java b/juick-server/src/main/java/com/juick/server/api/webhooks/TelegramWebhook.java index 9c4f64ce..10fd1ab3 100644 --- a/juick-server/src/main/java/com/juick/server/api/webhooks/TelegramWebhook.java +++ b/juick-server/src/main/java/com/juick/server/api/webhooks/TelegramWebhook.java @@ -19,6 +19,7 @@ package com.juick.server.api.webhooks; import com.juick.server.TelegramBotManager; import org.apache.commons.io.IOUtils; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -35,6 +36,7 @@ import java.nio.charset.StandardCharsets; */ @ApiIgnore @RestController +@ConditionalOnProperty(name = "telegram_token") public class TelegramWebhook { @Inject private TelegramBotManager telegramBotManager; |