From 67d8f281702fc80c2e590235630bfed8387ef29a Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Wed, 21 Dec 2022 21:43:29 +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=80=D0=B0=D0=B1=D0=BE=D1=82=D1=83=20=D1=81=20TriggerChecks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../bot/gitlab/telegram/unit/MenuConfig.java | 18 +++--------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/pom.xml b/pom.xml index 80f031d..cf7caba 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ UTF-8 UTF-8 - 0.0.47 + 0.0.48-SNAPSHOT 2.2 diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/MenuConfig.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/MenuConfig.java index 40105b1..d32df5e 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/MenuConfig.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/unit/MenuConfig.java @@ -1,9 +1,7 @@ package dev.struchkov.bot.gitlab.telegram.unit; -import dev.struchkov.bot.gitlab.context.domain.MergeRequestState; import dev.struchkov.bot.gitlab.context.domain.PersonInformation; import dev.struchkov.bot.gitlab.context.domain.entity.MergeRequest; -import dev.struchkov.bot.gitlab.context.domain.filter.MergeRequestFilter; import dev.struchkov.bot.gitlab.context.service.MergeRequestsService; import dev.struchkov.bot.gitlab.context.service.NoteService; import dev.struchkov.bot.gitlab.core.config.properties.GitlabProperty; @@ -18,7 +16,6 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; import java.text.MessageFormat; -import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -32,6 +29,7 @@ import static dev.struchkov.godfather.main.domain.BoxAnswer.boxAnswer; import static dev.struchkov.godfather.main.domain.keyboard.button.SimpleButton.simpleButton; import static dev.struchkov.godfather.main.domain.keyboard.simple.SimpleKeyBoardLine.simpleLine; import static dev.struchkov.godfather.telegram.domain.keyboard.InlineKeyBoard.inlineKeyBoard; +import static dev.struchkov.godfather.telegram.simple.core.util.TriggerChecks.clickButtonRaw; /** * // TODO: 16.01.2021 Добавить описание. @@ -80,7 +78,7 @@ public class MenuConfig { @Unit(ADD_NEW_PROJECT) MainUnit addNewProject ) { return AnswerText.builder() - .triggerPhrase(TEXT_ADD_NEW_PROJECT) + .triggerCheck(clickButtonRaw(TEXT_ADD_NEW_PROJECT)) .answer(boxAnswer("Copy the url of the project and send it to me")) .next(addNewProject) .build(); @@ -104,9 +102,7 @@ public class MenuConfig { public AnswerText settings() { return AnswerText.builder() .triggerPhrase(SETTINGS) - .answer( - boxAnswer("This is the settings menu") - ) + .answer(boxAnswer("This is the settings menu")) .build(); } @@ -148,12 +144,4 @@ public class MenuConfig { .build(); } - - private MergeRequestFilter getAssigneeFilter(Long userId) { - final MergeRequestFilter mergeRequestFilter = new MergeRequestFilter(); - mergeRequestFilter.setAssignee(userId); - mergeRequestFilter.setStates(Collections.singleton(MergeRequestState.OPENED)); - return mergeRequestFilter; - } - }