Доработка вебхуков
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Struchkov Mark 2023-03-19 19:08:41 +03:00
parent 2f3d7b9b10
commit c1febc78e9
Signed by: upagge
GPG Key ID: D3018BE7BA428CA6
3 changed files with 5 additions and 2 deletions

View File

@ -21,7 +21,7 @@ public class TelegramWebhookConnect implements TelegramConnect {
if (webhookConfig.isEnable()) { if (webhookConfig.isEnable()) {
log.info("Инициализация webhook соединения. {}", telegramBotConfig.getWebhookConfig()); log.info("Инициализация webhook соединения. {}", telegramBotConfig.getWebhookConfig());
final SetWebhook setWebhook = SetWebhook.builder() final SetWebhook setWebhook = SetWebhook.builder()
.url(webhookConfig.getRootUrl() + "/" + webhookConfig.getRootUrl() + "?webhookAccessKey=" + webhookConfig.getAccessKey()) .url(webhookConfig.getRootUrl() + "/" + webhookConfig.getControllerPath() + "/" + webhookConfig.getPath() + "?webhookAccessKey=" + webhookConfig.getAccessKey())
.build(); .build();
bot.setWebhook(setWebhook); bot.setWebhook(setWebhook);
webhookBot = bot; webhookBot = bot;

View File

@ -25,7 +25,7 @@ public class TelegramWebhookConnect implements TelegramConnect {
if (webhookConfig.isEnable()) { if (webhookConfig.isEnable()) {
log.info("Инициализация webhook соединения. {}", telegramBotConfig.getWebhookConfig()); log.info("Инициализация webhook соединения. {}", telegramBotConfig.getWebhookConfig());
final SetWebhook setWebhook = SetWebhook.builder() final SetWebhook setWebhook = SetWebhook.builder()
.url(webhookConfig.getRootUrl() + "/" + webhookConfig.getRootUrl() + "callback" + "?webhookAccessKey=" + webhookConfig.getAccessKey()) .url(webhookConfig.getRootUrl() + "/" + webhookConfig.getControllerPath() + "/" + webhookConfig.getPath() + "?webhookAccessKey=" + webhookConfig.getAccessKey())
.build(); .build();
bot.setWebhook(setWebhook); bot.setWebhook(setWebhook);
webhookBot = bot; webhookBot = bot;

View File

@ -14,6 +14,9 @@ public class WebhookConfig {
@ToString.Exclude @ToString.Exclude
private String rootUrl; private String rootUrl;
@ToString.Exclude
private String controllerPath;
@ToString.Exclude @ToString.Exclude
private String path; private String path;