mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-26 03:58:44 +00:00
commit
1655bedabe
@ -1,5 +1,10 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
|
## 9.1.2
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* Fix of `MessageContent` serialization
|
||||||
|
|
||||||
## 9.1.1
|
## 9.1.1
|
||||||
|
|
||||||
* `Core`:
|
* `Core`:
|
||||||
|
@ -6,4 +6,4 @@ kotlin.incremental=true
|
|||||||
kotlin.incremental.js=true
|
kotlin.incremental.js=true
|
||||||
|
|
||||||
library_group=dev.inmo
|
library_group=dev.inmo
|
||||||
library_version=9.1.1
|
library_version=9.1.2
|
||||||
|
@ -13,8 +13,10 @@ import dev.inmo.tgbotapi.types.media.TelegramMedia
|
|||||||
import dev.inmo.tgbotapi.types.message.abstracts.*
|
import dev.inmo.tgbotapi.types.message.abstracts.*
|
||||||
import dev.inmo.tgbotapi.types.threadId
|
import dev.inmo.tgbotapi.types.threadId
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.modules.*
|
import kotlinx.serialization.modules.*
|
||||||
|
|
||||||
|
@Serializable
|
||||||
sealed interface MessageContent: ResendableContent {
|
sealed interface MessageContent: ResendableContent {
|
||||||
companion object {
|
companion object {
|
||||||
@RiskFeature("This serialization module can be changed in near releases")
|
@RiskFeature("This serialization module can be changed in near releases")
|
||||||
@ -49,6 +51,7 @@ sealed interface MessageContent: ResendableContent {
|
|||||||
subclass(AnimationContent::class)
|
subclass(AnimationContent::class)
|
||||||
subclass(StickerContent::class)
|
subclass(StickerContent::class)
|
||||||
subclass(InvoiceContent::class)
|
subclass(InvoiceContent::class)
|
||||||
|
subclass(StoryContent::class)
|
||||||
|
|
||||||
additionalBuilder()
|
additionalBuilder()
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,6 @@ sealed interface LocationContent : MessageContent {
|
|||||||
/**
|
/**
|
||||||
* [KSerializer] for [LocationContent]
|
* [KSerializer] for [LocationContent]
|
||||||
*/
|
*/
|
||||||
@Serializer(LocationContent::class)
|
|
||||||
object LocationContentSerializer : KSerializer<LocationContent> {
|
object LocationContentSerializer : KSerializer<LocationContent> {
|
||||||
override val descriptor: SerialDescriptor = buildClassSerialDescriptor("LocationContent") {
|
override val descriptor: SerialDescriptor = buildClassSerialDescriptor("LocationContent") {
|
||||||
element(LocationContent::location.name, LocationSerializer.descriptor)
|
element(LocationContent::location.name, LocationSerializer.descriptor)
|
||||||
@ -85,7 +84,6 @@ object LocationContentSerializer : KSerializer<LocationContent> {
|
|||||||
encodeSerializableElement(descriptor, 0, LocationSerializer, value.location)
|
encodeSerializableElement(descriptor, 0, LocationSerializer, value.location)
|
||||||
}.endStructure(descriptor)
|
}.endStructure(descriptor)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -94,7 +92,7 @@ object LocationContentSerializer : KSerializer<LocationContent> {
|
|||||||
*
|
*
|
||||||
* @see dev.inmo.tgbotapi.extensions.behaviour_builder.utils.followLocation
|
* @see dev.inmo.tgbotapi.extensions.behaviour_builder.utils.followLocation
|
||||||
*/
|
*/
|
||||||
@Serializable(LocationContentSerializer::class)
|
@Serializable
|
||||||
data class LiveLocationContent(
|
data class LiveLocationContent(
|
||||||
override val location: LiveLocation
|
override val location: LiveLocation
|
||||||
) : LocationContent {
|
) : LocationContent {
|
||||||
@ -127,7 +125,7 @@ data class LiveLocationContent(
|
|||||||
* Just a [LocationContent] with [StaticLocation] [location]. It could be [LiveLocationContent] in previous time in case
|
* Just a [LocationContent] with [StaticLocation] [location]. It could be [LiveLocationContent] in previous time in case
|
||||||
* when somebody has sent [LiveLocation] in chat and then stop to broadcast location
|
* when somebody has sent [LiveLocation] in chat and then stop to broadcast location
|
||||||
*/
|
*/
|
||||||
@Serializable(LocationContentSerializer::class)
|
@Serializable
|
||||||
data class StaticLocationContent(
|
data class StaticLocationContent(
|
||||||
override val location: StaticLocation
|
override val location: StaticLocation
|
||||||
) : LocationContent {
|
) : LocationContent {
|
||||||
|
Loading…
Reference in New Issue
Block a user