Исправление форматирования сообщений
This commit is contained in:
parent
4eb678ce53
commit
905e13053e
@ -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.domain.notify.mergerequest.NewMrForAssignee;
|
||||||
import dev.struchkov.bot.gitlab.context.utils.Icons;
|
import dev.struchkov.bot.gitlab.context.utils.Icons;
|
||||||
import dev.struchkov.godfather.simple.domain.BoxAnswer;
|
import dev.struchkov.godfather.simple.domain.BoxAnswer;
|
||||||
|
import dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.List;
|
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_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.Const.BUTTON_VALUE_FALSE;
|
||||||
import static dev.struchkov.bot.gitlab.telegram.utils.UnitName.DELETE_MESSAGE;
|
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.InlineKeyBoard.inlineKeyBoard;
|
||||||
import static dev.struchkov.godfather.telegram.domain.keyboard.SimpleKeyBoardLine.keyBoardLine;
|
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.domain.keyboard.button.SimpleButton.simpleButton;
|
||||||
@ -59,8 +59,9 @@ public class NewMrForAssigneeNotifyGenerator implements NotifyBoxAnswerGenerator
|
|||||||
|
|
||||||
final String notifyMessage = builder.toString();
|
final String notifyMessage = builder.toString();
|
||||||
|
|
||||||
return boxAnswer(
|
return BoxAnswer.builder()
|
||||||
notifyMessage,
|
.message(notifyMessage)
|
||||||
|
.keyBoard(
|
||||||
inlineKeyBoard(
|
inlineKeyBoard(
|
||||||
keyBoardLine(
|
keyBoardLine(
|
||||||
simpleButton(Icons.VIEW, DELETE_MESSAGE),
|
simpleButton(Icons.VIEW, DELETE_MESSAGE),
|
||||||
@ -68,7 +69,9 @@ public class NewMrForAssigneeNotifyGenerator implements NotifyBoxAnswerGenerator
|
|||||||
simpleButton(Icons.DISABLE_NOTIFY, "[" + BUTTON_ARG_DISABLE_NOTIFY_MR_ID + ":" + notify.getMrId() + ";" + BUTTON_ARG_CONFIRMATION + ":" + BUTTON_VALUE_FALSE + "]")
|
simpleButton(Icons.DISABLE_NOTIFY, "[" + BUTTON_ARG_DISABLE_NOTIFY_MR_ID + ":" + notify.getMrId() + ";" + BUTTON_ARG_CONFIRMATION + ":" + BUTTON_VALUE_FALSE + "]")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
)
|
||||||
|
.payload(BoxAnswerPayload.ENABLE_MARKDOWN)
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -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.SimpleKeyBoardLine.keyBoardLine;
|
||||||
import static dev.struchkov.godfather.telegram.domain.keyboard.button.SimpleButton.simpleButton;
|
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.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.InlineKeyBoards.verticalMenuButton;
|
||||||
import static dev.struchkov.godfather.telegram.main.core.util.UnitTrigger.clickButtonRaw;
|
import static dev.struchkov.godfather.telegram.main.core.util.UnitTrigger.clickButtonRaw;
|
||||||
import static dev.struchkov.godfather.telegram.main.core.util.UnitTrigger.isButtonClick;
|
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(DISABLE_WEB_PAGE_PREVIEW, true)
|
||||||
|
.payload(ENABLE_MARKDOWN, true)
|
||||||
.keyBoard(
|
.keyBoard(
|
||||||
inlineKeyBoard(
|
inlineKeyBoard(
|
||||||
keyBoardLine(
|
keyBoardLine(
|
||||||
@ -609,6 +611,7 @@ public class InitSettingFlow implements PersonUnitConfiguration {
|
|||||||
"""
|
"""
|
||||||
).keyBoard(inlineKeyBoard(simpleButton("Open Menu", "/start")))
|
).keyBoard(inlineKeyBoard(simpleButton("Open Menu", "/start")))
|
||||||
.payload(DISABLE_WEB_PAGE_PREVIEW, true)
|
.payload(DISABLE_WEB_PAGE_PREVIEW, true)
|
||||||
|
.payload(ENABLE_MARKDOWN)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user