From 905e13053e16239f6aa203b4231bc1cfcb8cb6ac Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Fri, 19 Jan 2024 20:41:34 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=81=D0=BE?= =?UTF-8?q?=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NewMrForAssigneeNotifyGenerator.java | 21 +++++++++++-------- .../telegram/unit/flow/InitSettingFlow.java | 3 +++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForAssigneeNotifyGenerator.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForAssigneeNotifyGenerator.java index c1233eb..88b243d 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForAssigneeNotifyGenerator.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/NewMrForAssigneeNotifyGenerator.java @@ -3,6 +3,7 @@ package dev.struchkov.bot.gitlab.telegram.service.notify; import dev.struchkov.bot.gitlab.context.domain.notify.mergerequest.NewMrForAssignee; import dev.struchkov.bot.gitlab.context.utils.Icons; import dev.struchkov.godfather.simple.domain.BoxAnswer; +import dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload; import org.springframework.stereotype.Component; import java.util.List; @@ -12,7 +13,6 @@ import static dev.struchkov.bot.gitlab.telegram.utils.Const.BUTTON_ARG_CONFIRMAT import static dev.struchkov.bot.gitlab.telegram.utils.Const.BUTTON_ARG_DISABLE_NOTIFY_MR_ID; import static dev.struchkov.bot.gitlab.telegram.utils.Const.BUTTON_VALUE_FALSE; import static dev.struchkov.bot.gitlab.telegram.utils.UnitName.DELETE_MESSAGE; -import static dev.struchkov.godfather.simple.domain.BoxAnswer.boxAnswer; import static dev.struchkov.godfather.telegram.domain.keyboard.InlineKeyBoard.inlineKeyBoard; import static dev.struchkov.godfather.telegram.domain.keyboard.SimpleKeyBoardLine.keyBoardLine; import static dev.struchkov.godfather.telegram.domain.keyboard.button.SimpleButton.simpleButton; @@ -59,16 +59,19 @@ public class NewMrForAssigneeNotifyGenerator implements NotifyBoxAnswerGenerator final String notifyMessage = builder.toString(); - return boxAnswer( - notifyMessage, - inlineKeyBoard( - keyBoardLine( - simpleButton(Icons.VIEW, DELETE_MESSAGE), - urlButton(Icons.LINK, notify.getUrl()), - simpleButton(Icons.DISABLE_NOTIFY, "[" + BUTTON_ARG_DISABLE_NOTIFY_MR_ID + ":" + notify.getMrId() + ";" + BUTTON_ARG_CONFIRMATION + ":" + BUTTON_VALUE_FALSE + "]") + return BoxAnswer.builder() + .message(notifyMessage) + .keyBoard( + inlineKeyBoard( + keyBoardLine( + simpleButton(Icons.VIEW, DELETE_MESSAGE), + urlButton(Icons.LINK, notify.getUrl()), + simpleButton(Icons.DISABLE_NOTIFY, "[" + BUTTON_ARG_DISABLE_NOTIFY_MR_ID + ":" + notify.getMrId() + ";" + BUTTON_ARG_CONFIRMATION + ":" + BUTTON_VALUE_FALSE + "]") + ) ) ) - ); + .payload(BoxAnswerPayload.ENABLE_MARKDOWN) + .build(); } @Override diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/flow/InitSettingFlow.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/flow/InitSettingFlow.java index f153e11..84a5d5c 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/flow/InitSettingFlow.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/flow/InitSettingFlow.java @@ -50,6 +50,7 @@ import static dev.struchkov.godfather.telegram.domain.keyboard.InlineKeyBoard.in import static dev.struchkov.godfather.telegram.domain.keyboard.SimpleKeyBoardLine.keyBoardLine; import static dev.struchkov.godfather.telegram.domain.keyboard.button.SimpleButton.simpleButton; import static dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload.DISABLE_WEB_PAGE_PREVIEW; +import static dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload.ENABLE_MARKDOWN; import static dev.struchkov.godfather.telegram.main.core.util.InlineKeyBoards.verticalMenuButton; import static dev.struchkov.godfather.telegram.main.core.util.UnitTrigger.clickButtonRaw; import static dev.struchkov.godfather.telegram.main.core.util.UnitTrigger.isButtonClick; @@ -118,6 +119,7 @@ public class InitSettingFlow implements PersonUnitConfiguration { """ ) .payload(DISABLE_WEB_PAGE_PREVIEW, true) + .payload(ENABLE_MARKDOWN, true) .keyBoard( inlineKeyBoard( keyBoardLine( @@ -609,6 +611,7 @@ public class InitSettingFlow implements PersonUnitConfiguration { """ ).keyBoard(inlineKeyBoard(simpleButton("Open Menu", "/start"))) .payload(DISABLE_WEB_PAGE_PREVIEW, true) + .payload(ENABLE_MARKDOWN) .build(); } )