1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 16:23:48 +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 * Created a few of methods for all supported formats of text like bold, italic, links and others
* Rewritten `MessageEntities` to use new formatting options * 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 ## 0.11.0
* Kotlin `1.3.11` -> `1.3.21` * 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" project.group = "com.github.insanusmokrassar"
buildscript { 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 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> 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 import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.TelegramMediaFile
interface MediaContent<T: TelegramMediaFile>: MessageContent { interface MediaContent: MessageContent {
val media: T 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 import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.MediaGroupMemberInputMedia
interface MediaGroupContent : MessageContent { interface MediaGroupContent : MediaContent {
fun toMediaGroupMemberInputMedia(): MediaGroupMemberInputMedia fun toMediaGroupMemberInputMedia(): MediaGroupMemberInputMedia
} }

View File

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

View File

@ -17,7 +17,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<MessageEntity> = emptyList() override val captionEntities: List<MessageEntity> = emptyList()
) : MediaContent<AudioFile>, CaptionedMediaContent { ) : MediaContent, CaptionedMediaContent {
override fun createResend( override fun createResend(
chatId: ChatIdentifier, chatId: ChatIdentifier,
disableNotification: Boolean, disableNotification: Boolean,

View File

@ -17,7 +17,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<MessageEntity> = emptyList() override val captionEntities: List<MessageEntity> = emptyList()
) : MediaContent<DocumentFile>, CaptionedMediaContent { ) : MediaContent, CaptionedMediaContent {
override fun createResend( override fun createResend(
chatId: ChatIdentifier, chatId: ChatIdentifier,
disableNotification: Boolean, disableNotification: Boolean,

View File

@ -11,7 +11,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstract
data class StickerContent( data class StickerContent(
override val media: Sticker override val media: Sticker
) : MediaContent<Sticker> { ) : MediaContent {
override fun createResend( override fun createResend(
chatId: ChatIdentifier, chatId: ChatIdentifier,
disableNotification: Boolean, 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.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.files.VideoFile import com.github.insanusmokrassar.TelegramBotAPI.types.files.VideoFile
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage 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 import com.github.insanusmokrassar.TelegramBotAPI.utils.toHtmlCaptions
data class VideoContent( data class VideoContent(
override val media: VideoFile, override val media: VideoFile,
override val caption: String? = null, override val caption: String? = null,
override val captionEntities: List<MessageEntity> = emptyList() override val captionEntities: List<MessageEntity> = emptyList()
) : MediaContent<VideoFile>, CaptionedMediaContent, MediaGroupContent { ) : CaptionedMediaContent, MediaGroupContent {
override fun createResend( override fun createResend(
chatId: ChatIdentifier, chatId: ChatIdentifier,
disableNotification: Boolean, disableNotification: Boolean,

View File

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

View File

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