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

make different interfaces for audio and documents media content

This commit is contained in:
InsanusMokrassar 2020-11-02 12:51:09 +06:00
parent 1ee73dd406
commit d96d47e32c
3 changed files with 5 additions and 4 deletions

View File

@ -8,3 +8,5 @@ interface MediaGroupContent : MediaContent, CaptionedInput {
} }
interface VisualMediaGroupContent : MediaGroupContent interface VisualMediaGroupContent : MediaGroupContent
interface AudioMediaGroupContent : MediaGroupContent
interface DocumentMediaGroupContent : MediaGroupContent

View File

@ -19,7 +19,7 @@ data class AudioContent(
override val media: AudioFile, override val media: AudioFile,
override val caption: String? = null, override val caption: String? = null,
override val captionEntities: List<TextPart> = emptyList() override val captionEntities: List<TextPart> = emptyList()
) : MediaGroupContent { ) : AudioMediaGroupContent {
override fun createResend( override fun createResend(
chatId: ChatIdentifier, chatId: ChatIdentifier,
disableNotification: Boolean, disableNotification: Boolean,

View File

@ -13,8 +13,7 @@ import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.files.DocumentFile import dev.inmo.tgbotapi.types.files.DocumentFile
import dev.inmo.tgbotapi.types.files.asDocumentFile import dev.inmo.tgbotapi.types.files.asDocumentFile
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent import dev.inmo.tgbotapi.types.message.content.abstracts.*
import dev.inmo.tgbotapi.types.message.content.abstracts.MediaGroupContent
import dev.inmo.tgbotapi.utils.toHtmlCaptions import dev.inmo.tgbotapi.utils.toHtmlCaptions
import dev.inmo.tgbotapi.utils.toMarkdownV2Captions import dev.inmo.tgbotapi.utils.toMarkdownV2Captions
@ -22,7 +21,7 @@ data class DocumentContent(
override val media: DocumentFile, override val media: DocumentFile,
override val caption: String? = null, override val caption: String? = null,
override val captionEntities: List<TextPart> = emptyList() override val captionEntities: List<TextPart> = emptyList()
) : MediaGroupContent { ) : DocumentMediaGroupContent {
override fun createResend( override fun createResend(
chatId: ChatIdentifier, chatId: ChatIdentifier,
disableNotification: Boolean, disableNotification: Boolean,