From 982b401b28578d858a0a314e82c73cbd2e70b856 Mon Sep 17 00:00:00 2001 From: bpavuk Date: Wed, 10 Jul 2024 18:34:43 +0300 Subject: [PATCH] Added overloads with text and custom parsing mode instead of entities --- .../tgbotapi/extensions/api/send/Replies.kt | 34 ++++++++++++++++++ .../api/send/RepliesWithChatsAndMessages.kt | 35 +++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt index 8d460942c9..a35f8bbeff 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt @@ -2265,4 +2265,38 @@ suspend fun TelegramBot.reply( allowSendingWithoutReply = allowSendingWithoutReply ) ) +} + +suspend fun TelegramBot.reply( + to: AccessibleMessage, + starCount: Int, + media: List, + text: String? = null, + parseMode: ParseMode? = null, + showCaptionAboveMedia: Boolean = false, + threadId: MessageThreadId? = to.chat.id.threadId, + businessConnectionId: BusinessConnectionId? = to.chat.id.businessConnectionId, + disableNotification: Boolean = false, + protectContent: Boolean = false, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) { + sendPaidMedia( + chatId = to.chat.id, + starCount = starCount, + media = media, + text = text, + parseMode = parseMode, + showCaptionAboveMedia = showCaptionAboveMedia, + threadId = threadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + replyMarkup = replyMarkup, + replyParameters = ReplyParameters( + messageId = to.messageId, + chatIdentifier = to.chat.id, + allowSendingWithoutReply = allowSendingWithoutReply + ) + ) } \ No newline at end of file diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt index 05cabac9f6..b2b17673eb 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/RepliesWithChatsAndMessages.kt @@ -2081,3 +2081,38 @@ suspend fun TelegramBot.reply( ) ) } + +suspend fun TelegramBot.reply( + toChatId: IdChatIdentifier, + toMessageId: MessageId, + starCount: Int, + media: List, + text: String? = null, + parseMode: ParseMode? = null, + showCaptionAboveMedia: Boolean = false, + threadId: MessageThreadId? = toChatId.threadId, + businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId, + disableNotification: Boolean = false, + protectContent: Boolean = false, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) { + sendPaidMedia( + chatId = toChatId, + starCount = starCount, + media = media, + text = text, + parseMode = parseMode, + showCaptionAboveMedia = showCaptionAboveMedia, + threadId = threadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + replyMarkup = replyMarkup, + replyParameters = ReplyParameters( + messageId = toMessageId, + chatIdentifier = toChatId, + allowSendingWithoutReply = allowSendingWithoutReply + ) + ) +}