From f2fae9184f2bbab5e5fa55044b6eb28d08976b1c Mon Sep 17 00:00:00 2001 From: bpavuk Date: Wed, 10 Jul 2024 16:55:24 +0300 Subject: [PATCH] Fixed wrongly specified parameters --- .../api/send/RepliesWithChatsAndMessages.kt | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) 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 5b8dc824e2..05cabac9f6 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 @@ -2052,32 +2052,25 @@ suspend fun TelegramBot.reply( suspend fun TelegramBot.reply( toChatId: IdChatIdentifier, toMessageId: MessageId, - content: PaidMediaInfoContent, - replyInChatId: IdChatIdentifier = toChatId, - replyInThreadId: MessageThreadId? = replyInChatId.threadId, - replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.businessConnectionId, + starCount: Int, + media: List, + entities: TextSourcesList, + showCaptionAboveMedia: Boolean = false, + threadId: MessageThreadId? = toChatId.threadId, + businessConnectionId: BusinessConnectionId? = toChatId.businessConnectionId, disableNotification: Boolean = false, protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, - parseMode: ParseMode? = null, replyMarkup: KeyboardMarkup? = null ) { - val media = content.paidMediaInfo.media.mapNotNull { - when (it) { - is PaidMedia.Video -> it.toTelegramPaidMediaVideo() - is PaidMedia.Photo -> it.toTelegramMediaPhoto() - is PaidMedia.Preview, is PaidMedia.Unknown -> null - } - } sendPaidMedia( - chatId = replyInChatId, - starCount = content.paidMediaInfo.stars, + chatId = toChatId, + starCount = starCount, media = media, - text = content.text, - parseMode = parseMode, - showCaptionAboveMedia = content.showCaptionAboveMedia, - threadId = replyInThreadId, - businessConnectionId = replyInBusinessConnectionId, + entities = entities, + showCaptionAboveMedia = showCaptionAboveMedia, + threadId = threadId, + businessConnectionId = businessConnectionId, disableNotification = disableNotification, protectContent = protectContent, replyMarkup = replyMarkup, @@ -2088,4 +2081,3 @@ suspend fun TelegramBot.reply( ) ) } -