1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 16:23:48 +00:00
This commit is contained in:
InsanusMokrassar 2020-11-02 11:13:16 +06:00
parent 06ba21fc1f
commit 9e771fa04a
2 changed files with 10 additions and 11 deletions

View File

@ -38,7 +38,7 @@ internal object DiceAnimationTypeSerializer : KSerializer<DiceAnimationType> {
CubeDiceAnimationType.emoji -> CubeDiceAnimationType CubeDiceAnimationType.emoji -> CubeDiceAnimationType
DartsDiceAnimationType.emoji -> DartsDiceAnimationType DartsDiceAnimationType.emoji -> DartsDiceAnimationType
BasketballDiceAnimationType.emoji -> BasketballDiceAnimationType BasketballDiceAnimationType.emoji -> BasketballDiceAnimationType
SlotMachineDiceAnimationType.emoji -> BasketballDiceAnimationType SlotMachineDiceAnimationType.emoji -> SlotMachineDiceAnimationType
else -> CustomDiceAnimationType(type) else -> CustomDiceAnimationType(type)
} }
} }

View File

@ -220,17 +220,20 @@ internal data class RawMessage(
} }
} ?: content?.let { content -> } ?: content?.let { content ->
media_group_id?.let { media_group_id?.let {
val checkedContent = when (content) {
is PhotoContent -> content
is VideoContent -> content
is AudioContent -> content
is DocumentContent -> content
else -> error("Unsupported content for media group")
}
when (from) { when (from) {
null -> ChannelMediaGroupMessage( null -> ChannelMediaGroupMessage(
messageId, messageId,
chat, chat,
date.asDate, date.asDate,
it, it,
when (content) { checkedContent,
is PhotoContent -> content
is VideoContent -> content
else -> error("Unsupported content for media group")
},
edit_date?.asDate, edit_date?.asDate,
forwarded, forwarded,
reply_to_message?.asMessage, reply_to_message?.asMessage,
@ -242,11 +245,7 @@ internal data class RawMessage(
chat, chat,
date.asDate, date.asDate,
it, it,
when (content) { checkedContent,
is PhotoContent -> content
is VideoContent -> content
else -> error("Unsupported content for media group")
},
edit_date?.asDate, edit_date?.asDate,
forwarded, forwarded,
reply_to_message?.asMessage, reply_to_message?.asMessage,