Доработка вебхуков
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()) {
log.info("Инициализация webhook соединения. {}", telegramBotConfig.getWebhookConfig());
final SetWebhook setWebhook = SetWebhook.builder()
.url(webhookConfig.getRootUrl() + "/" + webhookConfig.getRootUrl() + "?webhookAccessKey=" + webhookConfig.getAccessKey())
.url(webhookConfig.getRootUrl() + "/" + webhookConfig.getControllerPath() + "/" + webhookConfig.getPath() + "?webhookAccessKey=" + webhookConfig.getAccessKey())
.build();
bot.setWebhook(setWebhook);
webhookBot = bot;

View File

@ -25,7 +25,7 @@ public class TelegramWebhookConnect implements TelegramConnect {
if (webhookConfig.isEnable()) {
log.info("Инициализация webhook соединения. {}", telegramBotConfig.getWebhookConfig());
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();
bot.setWebhook(setWebhook);
webhookBot = bot;

View File

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