From 56d09f7639cbccf5f605ae31858bbcbe894c32bf Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Wed, 8 Feb 2023 02:57:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE?= =?UTF-8?q?=20=D0=B4=D0=BB=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D0=BE=D0=BC?= =?UTF-8?q?=20=D0=BE=D0=B6=D0=B8=D0=B4=D0=B0=D0=BD=D0=B8=D0=B8=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D0=B8=D0=BD=D0=B8=D1=86=D0=B8=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D0=B7=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gitlab/telegram/unit/flow/InitSettingFlow.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 6906a76..960a2cc 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 @@ -14,7 +14,6 @@ import dev.struchkov.godfather.main.domain.annotation.Unit; import dev.struchkov.godfather.main.domain.content.Mail; import dev.struchkov.godfather.simple.core.unit.AnswerText; import dev.struchkov.godfather.simple.core.unit.MainUnit; -import dev.struchkov.godfather.simple.data.StorylineContext; import dev.struchkov.godfather.telegram.domain.attachment.ButtonClickAttachment; import dev.struchkov.godfather.telegram.main.core.util.Attachments; import dev.struchkov.godfather.telegram.simple.context.service.TelegramSending; @@ -57,7 +56,6 @@ import static java.text.MessageFormat.format; public class InitSettingFlow { private final TelegramSending sending; - private final StorylineContext context; private final PersonInformation personInformation; @@ -138,7 +136,7 @@ public class InitSettingFlow { ) { return AnswerText.builder() .triggerCheck(clickButtonRaw("NO")) - .answer(replaceBoxAnswer("Okay, I won't scan public projects.")) + .answer(replaceBoxAnswer("\uD83D\uDC4C I won't scan public projects.")) .callBack( sentBox -> scheduledExecutorService.schedule(() -> sending.deleteMessage(sentBox.getPersonId(), sentBox.getMessageId()), 10, TimeUnit.SECONDS) ) @@ -260,6 +258,7 @@ public class InitSettingFlow { .answer(mail -> { final ButtonClickAttachment buttonClick = Attachments.findFirstButtonClick(mail.getAttachments()).orElseThrow(); if ("YES".equals(buttonClick.getRawCallBackData())) { + sending.replaceMessage(mail.getPersonId(), mail.getId(), boxAnswer("⌛I write down the available projects. This may take a long time.")); projectParser.parseAllProjectOwner(); settingService.ownerProjectScan(true); } else { @@ -378,7 +377,7 @@ public class InitSettingFlow { ) { return AnswerText.builder() .triggerPhrase("NO") - .answer(replaceBoxAnswer("Okay, I won't scan private projects.")) + .answer(replaceBoxAnswer("\uD83D\uDC4C I won't scan private projects.")) .callBack( sentBox -> scheduledExecutorService.schedule(() -> sending.deleteMessage(sentBox.getPersonId(), sentBox.getMessageId()), 10, TimeUnit.SECONDS) ) @@ -394,7 +393,11 @@ public class InitSettingFlow { .activeType(AFTER) .answer( boxAnswer( - "Do you want to enable automatic notification of new private projects available to you?", + """ + Do you want to enable automatic notification of new private projects available to you? + -- -- -- -- -- + I will be forced to scan all available private projects for this. I will not scan other entities in projects and send any notifications for these projects. + """, inlineKeyBoard( simpleLine( simpleButton("Yes", "YES"), @@ -416,6 +419,7 @@ public class InitSettingFlow { .answer(mail -> { final ButtonClickAttachment buttonClick = Attachments.findFirstButtonClick(mail.getAttachments()).orElseThrow(); if ("YES".equals(buttonClick.getRawCallBackData())) { + sending.replaceMessage(mail.getPersonId(), mail.getId(), boxAnswer("⌛I write down the available private projects. This may take a long time.")); projectParser.parseAllPrivateProject(); settingService.privateProjectScan(true); } else {