Добавил логирование инициализации вебхука
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
be8d9a3c82
commit
c2d9b5db78
@ -15,10 +15,7 @@ public class TelegramWebhookConnect implements TelegramConnect {
|
||||
private TelegramWebhookBot webhookBot;
|
||||
|
||||
public TelegramWebhookConnect(TelegramBotConfig telegramBotConfig) {
|
||||
initWebHook(telegramBotConfig);
|
||||
}
|
||||
|
||||
private void initWebHook(TelegramBotConfig telegramBotConfig) {
|
||||
log.info("Инициализация webhook соединения. {}", telegramBotConfig.getWebhookConfig());
|
||||
try {
|
||||
final TelegramWebhookBot bot = new TelegramWebhookBot(telegramBotConfig);
|
||||
final WebhookConfig webhookConfig = telegramBotConfig.getWebhookConfig();
|
||||
@ -28,6 +25,7 @@ public class TelegramWebhookConnect implements TelegramConnect {
|
||||
.build();
|
||||
bot.setWebhook(setWebhook);
|
||||
webhookBot = bot;
|
||||
log.info("Инициализация webhook соединения прошла успешно.");
|
||||
}
|
||||
} catch (TelegramApiException e) {
|
||||
log.error(e.getMessage());
|
||||
|
@ -19,6 +19,7 @@ public class TelegramWebhookConnect implements TelegramConnect {
|
||||
}
|
||||
|
||||
private void initWebHook(TelegramBotConfig telegramBotConfig) {
|
||||
log.info("Инициализация webhook соединения. {}", telegramBotConfig.getWebhookConfig());
|
||||
try {
|
||||
final TelegramWebhookBot bot = new TelegramWebhookBot(telegramBotConfig);
|
||||
final WebhookConfig webhookConfig = telegramBotConfig.getWebhookConfig();
|
||||
@ -28,6 +29,7 @@ public class TelegramWebhookConnect implements TelegramConnect {
|
||||
.build();
|
||||
bot.setWebhook(setWebhook);
|
||||
webhookBot = bot;
|
||||
log.info("Инициализация webhook соединения прошла успешно.");
|
||||
}
|
||||
} catch (TelegramApiException e) {
|
||||
log.error(e.getMessage());
|
||||
|
@ -2,6 +2,7 @@ package dev.struchkov.godfather.telegram.domain.config;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* TODO: Добавить описание класса.
|
||||
@ -10,13 +11,24 @@ import lombok.Setter;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class ProxyConfig {
|
||||
|
||||
private boolean enable = false;
|
||||
|
||||
@ToString.Exclude
|
||||
private String host;
|
||||
|
||||
@ToString.Exclude
|
||||
private Integer port;
|
||||
|
||||
@ToString.Exclude
|
||||
private String user;
|
||||
|
||||
@ToString.Exclude
|
||||
private String password;
|
||||
|
||||
@ToString.Exclude
|
||||
private Type type;
|
||||
|
||||
public enum Type {
|
||||
|
@ -3,6 +3,7 @@ package dev.struchkov.godfather.telegram.domain.config;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* TODO: Добавить описание класса.
|
||||
@ -11,10 +12,13 @@ import lombok.Setter;
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
public class TelegramBotConfig {
|
||||
|
||||
private String username;
|
||||
|
||||
@ToString.Exclude
|
||||
private String token;
|
||||
|
||||
private ProxyConfig proxyConfig;
|
||||
|
@ -2,14 +2,22 @@ package dev.struchkov.godfather.telegram.domain.config;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class WebhookConfig {
|
||||
|
||||
private boolean enable = false;
|
||||
|
||||
@ToString.Exclude
|
||||
private String rootUrl;
|
||||
|
||||
@ToString.Exclude
|
||||
private String path;
|
||||
|
||||
@ToString.Exclude
|
||||
private String accessKey;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user