1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 00:03:48 +00:00

Added to: AccessibleMessage overload

This commit is contained in:
bpavuk 2024-07-10 16:39:52 +03:00
parent 05341be534
commit f89849218a
No known key found for this signature in database
GPG Key ID: B501D26D9DEA9CFE

View File

@ -2049,6 +2049,45 @@ suspend fun TelegramBot.reply(
}
}
suspend fun TelegramBot.reply(
to: AccessibleMessage,
content: PaidMediaInfoContent,
replyInChatId: IdChatIdentifier = to.chat.id,
replyInThreadId: MessageThreadId? = replyInChatId.threadId,
replyInBusinessConnectionId: BusinessConnectionId? = replyInChatId.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,
media = media,
text = content.text,
parseMode = parseMode,
showCaptionAboveMedia = content.showCaptionAboveMedia,
threadId = replyInThreadId,
businessConnectionId = replyInBusinessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
replyMarkup = replyMarkup,
replyParameters = ReplyParameters(
messageId = to.messageId,
chatIdentifier = to.chat.id,
allowSendingWithoutReply = allowSendingWithoutReply
)
)
}
suspend fun TelegramBot.reply(
toChatId: IdChatIdentifier,
toMessageId: MessageId,
@ -2088,3 +2127,4 @@ suspend fun TelegramBot.reply(
)
)
}