From 763e08e96ec44cf453cd9dae3a200bb9e12d2858 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Wed, 4 Sep 2024 00:19:07 +0300 Subject: [PATCH] added BoxAnswerPayload.THREAD_ID --- .../godfather/telegram/main/context/BoxAnswerPayload.java | 1 + .../godfather/telegram/simple/sender/TelegramSender.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/telegram-context/telegram-context-main/src/main/java/dev/struchkov/godfather/telegram/main/context/BoxAnswerPayload.java b/telegram-context/telegram-context-main/src/main/java/dev/struchkov/godfather/telegram/main/context/BoxAnswerPayload.java index d0090bf..60f48d3 100644 --- a/telegram-context/telegram-context-main/src/main/java/dev/struchkov/godfather/telegram/main/context/BoxAnswerPayload.java +++ b/telegram-context/telegram-context-main/src/main/java/dev/struchkov/godfather/telegram/main/context/BoxAnswerPayload.java @@ -11,6 +11,7 @@ public final class BoxAnswerPayload { public static final ContextKey ENABLE_MARKDOWN = ContextKey.of("ENABLE_MARKDOWN", Boolean.class); public static final ContextKey ENABLE_HTML = ContextKey.of("ENABLE_HTML", Boolean.class); public static final ContextKey INVOICE = ContextKey.of("INVOICE", SendInvoice.class); + public static final ContextKey THREAD_ID = ContextKey.of("THREAD_ID", Integer.class); private BoxAnswerPayload() { Exceptions.utilityClass(); diff --git a/telegram-sender/telegram-sender-simple/src/main/java/dev/struchkov/godfather/telegram/simple/sender/TelegramSender.java b/telegram-sender/telegram-sender-simple/src/main/java/dev/struchkov/godfather/telegram/simple/sender/TelegramSender.java index 8f02f15..d6b2da1 100644 --- a/telegram-sender/telegram-sender-simple/src/main/java/dev/struchkov/godfather/telegram/simple/sender/TelegramSender.java +++ b/telegram-sender/telegram-sender-simple/src/main/java/dev/struchkov/godfather/telegram/simple/sender/TelegramSender.java @@ -41,6 +41,7 @@ import static dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload.DIS import static dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload.DISABLE_WEB_PAGE_PREVIEW; import static dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload.ENABLE_HTML; import static dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload.ENABLE_MARKDOWN; +import static dev.struchkov.godfather.telegram.main.context.BoxAnswerPayload.THREAD_ID; import static dev.struchkov.godfather.telegram.main.sender.util.KeyBoardConvert.convertInlineKeyBoard; import static dev.struchkov.godfather.telegram.main.sender.util.KeyBoardConvert.convertKeyBoard; import static dev.struchkov.haiti.utils.Checker.checkNotBlank; @@ -418,6 +419,7 @@ public class TelegramSender implements TelegramSending { boxAnswer.getPayLoad(ENABLE_MARKDOWN).ifPresent(sendMessage::enableMarkdown); boxAnswer.getPayLoad(ENABLE_HTML).ifPresent(sendMessage::enableHtml); + boxAnswer.getPayLoad(THREAD_ID).ifPresent(sendMessage::setMessageThreadId); boxAnswer.getPayLoad(DISABLE_WEB_PAGE_PREVIEW).ifPresent(isDisable -> { if (TRUE.equals(isDisable)) sendMessage.disableWebPagePreview(); });