Исправления в TelegramSender
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
efe3e042e2
commit
317fd066c9
@ -170,10 +170,14 @@ public class TelegramSender implements TelegramSending {
|
||||
final EditMessageText editMessageText = new EditMessageText();
|
||||
editMessageText.setChatId(telegramId);
|
||||
editMessageText.setMessageId(Integer.parseInt(lastMessageId));
|
||||
editMessageText.enableMarkdown(true);
|
||||
editMessageText.setText(boxAnswer.getMessage());
|
||||
editMessageText.setReplyMarkup(convertInlineKeyBoard((InlineKeyBoard) boxAnswer.getKeyBoard()));
|
||||
|
||||
boxAnswer.getPayLoad(ENABLE_MARKDOWN).ifPresent(editMessageText::enableMarkdown);
|
||||
boxAnswer.getPayLoad(DISABLE_WEB_PAGE_PREVIEW).ifPresent(isDisable -> {
|
||||
if (TRUE.equals(isDisable)) editMessageText.disableWebPagePreview();
|
||||
});
|
||||
|
||||
return Uni.createFrom().completionStage(executeAsync(editMessageText))
|
||||
.onItem().ifNotNull().transformToUni(t -> Uni.createFrom().optional(SentBox.optional(telegramId, lastMessageId, boxAnswer, boxAnswer)))
|
||||
.onFailure(TelegramApiRequestException.class).recoverWithUni(
|
||||
|
@ -96,9 +96,14 @@ public class TelegramSender implements TelegramSending {
|
||||
public void replaceInlineMessage(String inlineMessageId, BoxAnswer boxAnswer) {
|
||||
final EditMessageText editMessageText = new EditMessageText();
|
||||
editMessageText.setInlineMessageId(inlineMessageId);
|
||||
editMessageText.enableMarkdown(true);
|
||||
editMessageText.setText(boxAnswer.getMessage());
|
||||
editMessageText.setReplyMarkup(convertInlineKeyBoard((InlineKeyBoard) boxAnswer.getKeyBoard()));
|
||||
|
||||
boxAnswer.getPayLoad(ENABLE_MARKDOWN).ifPresent(editMessageText::enableMarkdown);
|
||||
boxAnswer.getPayLoad(DISABLE_WEB_PAGE_PREVIEW).ifPresent(isDisable -> {
|
||||
if (TRUE.equals(isDisable)) editMessageText.disableWebPagePreview();
|
||||
});
|
||||
|
||||
try {
|
||||
absSender.execute(editMessageText);
|
||||
} catch (TelegramApiRequestException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user