From 23e01a314540f174be639dc8b46f1463af111469 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Wed, 10 May 2023 00:14:27 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B8=20=D1=80=D0=B0=D0=B7=D0=B1?= =?UTF-8?q?=D0=B8=D0=B2=D0=BA=D0=B5=20=D0=B1=D0=BE=D0=BB=D1=8C=D1=88=D0=BE?= =?UTF-8?q?=D0=B3=D0=BE=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BD=D0=B0=20=D0=BD=D0=B5=D1=81=D0=BA=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=BA=D0=BE=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=BA=D0=BB=D0=B0=D0=B2=D0=B8=D0=B0=D1=82=D1=83=D1=80=D1=83?= =?UTF-8?q?=20=D0=B2=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=D0=B4=D0=BD=D0=B5?= =?UTF-8?q?=D0=B5=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../telegram/quarkus/sender/TelegramSender.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/telegram-sender/telegram-sender-quarkus/src/main/java/dev/struchkov/godfather/telegram/quarkus/sender/TelegramSender.java b/telegram-sender/telegram-sender-quarkus/src/main/java/dev/struchkov/godfather/telegram/quarkus/sender/TelegramSender.java index 24e8878..dba589b 100644 --- a/telegram-sender/telegram-sender-quarkus/src/main/java/dev/struchkov/godfather/telegram/quarkus/sender/TelegramSender.java +++ b/telegram-sender/telegram-sender-quarkus/src/main/java/dev/struchkov/godfather/telegram/quarkus/sender/TelegramSender.java @@ -320,19 +320,21 @@ public class TelegramSender implements TelegramSending { while (message.length() > maxMessageLength) { String subMessage = message.substring(0, maxMessageLength); message = message.substring(maxMessageLength); - split.add(createNewTextAnswer(boxAnswer, subMessage)); + split.add(createNewTextAnswer(boxAnswer, subMessage, false)); } - split.add(createNewTextAnswer(boxAnswer, message)); + split.add(createNewTextAnswer(boxAnswer, message, true)); return Multi.createFrom().iterable(split); } - private SendMessage createNewTextAnswer(BoxAnswer boxAnswer, String subMessage) { + private SendMessage createNewTextAnswer(BoxAnswer boxAnswer, String subMessage, boolean lastMessage) { final SendMessage sendMessage = new SendMessage(); sendMessage.setChatId(boxAnswer.getRecipientPersonId()); sendMessage.setText(subMessage); - sendMessage.setReplyMarkup(convertKeyBoard(boxAnswer.getKeyBoard())); + if (lastMessage) { + sendMessage.setReplyMarkup(convertKeyBoard(boxAnswer.getKeyBoard())); + } boxAnswer.getPayLoad(ENABLE_MARKDOWN).ifPresent(sendMessage::enableMarkdown); boxAnswer.getPayLoad(ENABLE_HTML).ifPresent(sendMessage::enableHtml);