mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 00:03:48 +00:00
MediaGroupMessage is CommonMessage
This commit is contained in:
parent
03e7ca532d
commit
e774f958af
@ -15,6 +15,7 @@
|
||||
|
||||
* Change algorithm of `executeUnsafe`: now it use loop instead of recursive calling
|
||||
* Add additional `startGettingUpdates` with better management of received updates for media groups
|
||||
* Now `MediaGroupMessage` is `CommonMessage` with `MediaGroupContent` content
|
||||
|
||||
## 0.9.0
|
||||
|
||||
|
@ -13,5 +13,8 @@ data class CommonMediaGroupMessage(
|
||||
override val chat: Chat,
|
||||
override val date: DateTime,
|
||||
override val mediaGroupId: MediaGroupIdentifier,
|
||||
override val content: MediaGroupContent
|
||||
override val content: MediaGroupContent,
|
||||
override val editDate: DateTime?,
|
||||
override val forwarded: ForwardedMessage?,
|
||||
override val replyTo: Message?
|
||||
) : Message, MediaGroupMessage, FromUserMessage
|
||||
|
@ -13,5 +13,8 @@ data class MediaGroupMessage(
|
||||
override val chat: Chat,
|
||||
override val date: DateTime,
|
||||
override val mediaGroupId: MediaGroupIdentifier,
|
||||
override val content: MediaGroupContent
|
||||
override val content: MediaGroupContent,
|
||||
override val editDate: DateTime?,
|
||||
override val forwarded: ForwardedMessage?,
|
||||
override val replyTo: Message?
|
||||
) : Message, MediaGroupMessage
|
||||
|
@ -219,7 +219,10 @@ data class RawMessage(
|
||||
is PhotoContent -> content
|
||||
is VideoContent -> content
|
||||
else -> throw IllegalStateException("Unsupported content for media group")
|
||||
}
|
||||
},
|
||||
edit_date ?.asDate,
|
||||
forwarded,
|
||||
reply_to_message ?.asMessage
|
||||
)
|
||||
else -> CommonMediaGroupMessage(
|
||||
messageId,
|
||||
@ -231,7 +234,10 @@ data class RawMessage(
|
||||
is PhotoContent -> content
|
||||
is VideoContent -> content
|
||||
else -> throw IllegalStateException("Unsupported content for media group")
|
||||
}
|
||||
},
|
||||
edit_date ?.asDate,
|
||||
forwarded,
|
||||
reply_to_message ?.asMessage
|
||||
)
|
||||
}
|
||||
} ?: when (chat) {
|
||||
|
@ -3,7 +3,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MediaGroupIdentifier
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaGroupContent
|
||||
|
||||
interface MediaGroupMessage : Message {
|
||||
interface MediaGroupMessage : CommonMessage<MediaGroupContent> {
|
||||
val mediaGroupId: MediaGroupIdentifier
|
||||
val content: MediaGroupContent
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user