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

media group messages refactoring

This commit is contained in:
InsanusMokrassar 2019-03-21 08:45:51 +08:00
parent 15686f742a
commit ed341c231d
4 changed files with 6 additions and 4 deletions

View File

@ -42,6 +42,8 @@ for receivers.
* Refactor, optimizing and cleaning of code * Refactor, optimizing and cleaning of code
* Removed deprecated method `T#toJsonWithoutNulls()` * Removed deprecated method `T#toJsonWithoutNulls()`
* Renamed instances of `MediaGroupMessage`s and refactored their interfaces. `ChannelMediaGroupMessage`
will not contain `user` field (but `CommonMediaGroupMessage` will have)
## 0.11.0 ## 0.11.0

View File

@ -8,7 +8,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Messag
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaGroupContent import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaGroupContent
import org.joda.time.DateTime import org.joda.time.DateTime
data class MediaGroupMessage( data class ChannelMediaGroupMessage(
override val messageId: MessageIdentifier, override val messageId: MessageIdentifier,
override val chat: Chat, override val chat: Chat,
override val date: DateTime, override val date: DateTime,
@ -17,4 +17,4 @@ data class MediaGroupMessage(
override val editDate: DateTime?, override val editDate: DateTime?,
override val forwarded: ForwardedMessage?, override val forwarded: ForwardedMessage?,
override val replyTo: Message? override val replyTo: Message?
) : Message, MediaGroupMessage ) : MediaGroupMessage

View File

@ -17,4 +17,4 @@ data class CommonMediaGroupMessage(
override val editDate: DateTime?, override val editDate: DateTime?,
override val forwarded: ForwardedMessage?, override val forwarded: ForwardedMessage?,
override val replyTo: Message? override val replyTo: Message?
) : Message, MediaGroupMessage, FromUserMessage ) : MediaGroupMessage, FromUserMessage

View File

@ -210,7 +210,7 @@ data class RawMessage(
content -> content ->
media_group_id ?.let { media_group_id ?.let {
when (from) { when (from) {
null -> MediaGroupMessage( null -> ChannelMediaGroupMessage(
messageId, messageId,
chat, chat,
date.asDate, date.asDate,