diff options
author | 2018-06-14 15:04:16 +0300 | |
---|---|---|
committer | 2018-06-14 15:04:16 +0300 | |
commit | ca37c96de0f2a5beb097f560949ecfaeb7a86880 (patch) | |
tree | 3f4b54e26450f6f65bebdfd8f3caa8160f138484 /juick-server/src/main/java/com/juick/server/configuration/TelegramConfig.java | |
parent | 2236eee046e3ce304a3adcd9305ae6d6d2555003 (diff) |
Do not initialize telegram bot when token is missing
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/configuration/TelegramConfig.java')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/configuration/TelegramConfig.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/configuration/TelegramConfig.java b/juick-server/src/main/java/com/juick/server/configuration/TelegramConfig.java new file mode 100644 index 00000000..ebd1fd15 --- /dev/null +++ b/juick-server/src/main/java/com/juick/server/configuration/TelegramConfig.java @@ -0,0 +1,15 @@ +package com.juick.server.configuration; + +import com.juick.server.TelegramBotManager; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +@ConditionalOnProperty(name = "telegram_token") +public class TelegramConfig { + @Bean + public TelegramBotManager telegramBotManager() { + return new TelegramBotManager(); + } +} |