1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-23 00:57:13 +00:00

Merge pull request #27 from InsanusMokrassar/0.12.5

0.12.5 MediaContent improvements
This commit is contained in:
InsanusMokrassar 2019-04-05 00:14:47 -05:00 committed by GitHub
commit 6ea7b357d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 19 additions and 13 deletions

View File

@ -62,6 +62,11 @@ of `]` in links titles
* Created a few of methods for all supported formats of text like bold, italic, links and others
* Rewritten `MessageEntities` to use new formatting options
### 0.12.5 `MediaContent` improvements
* Now `MediaGroupContent` is `MediaContent`
* All `MedaContent` now have no generics and have basic `TelegramMediaFile` media field
## 0.11.0
* Kotlin `1.3.11` -> `1.3.21`

View File

@ -1,4 +1,4 @@
project.version = "0.12.4"
project.version = "0.12.5"
project.group = "com.github.insanusmokrassar"
buildscript {

View File

@ -2,6 +2,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstrac
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.TelegramMediaFile
interface MediaCollectionContent<T: TelegramMediaFile>: MessageContent, MediaContent<T> {
interface MediaCollectionContent<T: TelegramMediaFile>: MessageContent, MediaContent {
val mediaCollection: List<T>
}

View File

@ -2,6 +2,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstrac
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.TelegramMediaFile
interface MediaContent<T: TelegramMediaFile>: MessageContent {
val media: T
interface MediaContent: MessageContent {
val media: TelegramMediaFile
}

View File

@ -2,6 +2,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstrac
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.MediaGroupMemberInputMedia
interface MediaGroupContent : MessageContent {
interface MediaGroupContent : MediaContent {
fun toMediaGroupMemberInputMedia(): MediaGroupMemberInputMedia
}

View File

@ -14,7 +14,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstract
data class AnimationContent(
override val media: AnimationFile,
val includedDocument: DocumentFile?
) : MediaContent<AnimationFile> {
) : MediaContent {
override fun createResend(
chatId: ChatIdentifier,
disableNotification: Boolean,

View File

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

View File

@ -17,7 +17,7 @@ data class DocumentContent(
override val media: DocumentFile,
override val caption: String? = null,
override val captionEntities: List<MessageEntity> = emptyList()
) : MediaContent<DocumentFile>, CaptionedMediaContent {
) : MediaContent, CaptionedMediaContent {
override fun createResend(
chatId: ChatIdentifier,
disableNotification: Boolean,

View File

@ -11,7 +11,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstract
data class StickerContent(
override val media: Sticker
) : MediaContent<Sticker> {
) : MediaContent {
override fun createResend(
chatId: ChatIdentifier,
disableNotification: Boolean,

View File

@ -11,14 +11,15 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.HTMLParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.files.VideoFile
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.CaptionedMediaContent
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaGroupContent
import com.github.insanusmokrassar.TelegramBotAPI.utils.toHtmlCaptions
data class VideoContent(
override val media: VideoFile,
override val caption: String? = null,
override val captionEntities: List<MessageEntity> = emptyList()
) : MediaContent<VideoFile>, CaptionedMediaContent, MediaGroupContent {
) : CaptionedMediaContent, MediaGroupContent {
override fun createResend(
chatId: ChatIdentifier,
disableNotification: Boolean,

View File

@ -12,7 +12,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstract
data class VideoNoteContent(
override val media: VideoNoteFile
) : MediaContent<VideoNoteFile> {
) : MediaContent {
override fun createResend(
chatId: ChatIdentifier,
disableNotification: Boolean,

View File

@ -17,7 +17,7 @@ data class VoiceContent(
override val media: VoiceFile,
override val caption: String? = null,
override val captionEntities: List<MessageEntity> = emptyList()
) : MediaContent<VoiceFile>, CaptionedMediaContent {
) : MediaContent, CaptionedMediaContent {
override fun createResend(
chatId: ChatIdentifier,
disableNotification: Boolean,