Поправил вывод описания нового проекта

This commit is contained in:
Struchkov Mark 2023-02-15 21:52:35 +03:00
parent c3fd063880
commit 7f13cef76d
Signed by: upagge
GPG Key ID: D3018BE7BA428CA6
3 changed files with 8 additions and 8 deletions

View File

@ -107,13 +107,13 @@
<dependency> <dependency>
<groupId>dev.struchkov.haiti</groupId> <groupId>dev.struchkov.haiti</groupId>
<artifactId>haiti-utils</artifactId> <artifactId>haiti-utils</artifactId>
<version>2.3.4</version> <version>2.5.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>dev.struchkov.haiti</groupId> <groupId>dev.struchkov.haiti</groupId>
<artifactId>haiti-exception</artifactId> <artifactId>haiti-exception</artifactId>
<version>2.3.4</version> <version>2.5.0</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -27,11 +27,10 @@ public class StartNotify {
final BoxAnswer boxAnswer = BoxAnswer.builder() final BoxAnswer boxAnswer = BoxAnswer.builder()
.recipientPersonId(personProperty.getTelegramId()) .recipientPersonId(personProperty.getTelegramId())
.message( .message(
new StringBuilder() "Hello. I wish you a productive work day \uD83C\uDF40" +
.append("Hello. I wish you a productive day :)") "\n-- -- -- -- --\n" +
.append("\n-- -- -- -- --\n") "Version " + appProperty.getVersion() +
.append("Version ").append(appProperty.getVersion()).append(" | Developer: [uPagge](https://mark.struchkov.dev)") "\nDeveloper: [uPagge](https://mark.struchkov.dev)"
.toString()
).build(); ).build();
sending.send(boxAnswer); sending.send(boxAnswer);

View File

@ -4,6 +4,7 @@ import dev.struchkov.bot.gitlab.context.domain.notify.project.NewProjectNotify;
import dev.struchkov.bot.gitlab.context.utils.Icons; import dev.struchkov.bot.gitlab.context.utils.Icons;
import dev.struchkov.bot.gitlab.telegram.utils.Const; import dev.struchkov.bot.gitlab.telegram.utils.Const;
import dev.struchkov.godfather.main.domain.BoxAnswer; import dev.struchkov.godfather.main.domain.BoxAnswer;
import dev.struchkov.haiti.utils.Checker;
import dev.struchkov.haiti.utils.Strings; import dev.struchkov.haiti.utils.Strings;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -23,7 +24,7 @@ public class NewProjectNotifyGenerator implements NotifyBoxAnswerGenerator<NewPr
@Override @Override
public BoxAnswer generate(NewProjectNotify notify) { public BoxAnswer generate(NewProjectNotify notify) {
final Optional<String> optDescription = Optional.ofNullable(notify.getProjectDescription()) final Optional<String> optDescription = Optional.ofNullable(notify.getProjectDescription())
.filter(Strings.EMPTY::equals) .filter(Checker::checkNotBlank)
.map(Strings::escapeMarkdown); .map(Strings::escapeMarkdown);
final StringBuilder builder = new StringBuilder(Icons.FUN).append("* New project*") final StringBuilder builder = new StringBuilder(Icons.FUN).append("* New project*")