mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-27 20:48:44 +00:00
chatmember serializers are public
This commit is contained in:
parent
8afa8bb927
commit
7414a9b41b
@ -5,8 +5,10 @@
|
|||||||
* `Common`:
|
* `Common`:
|
||||||
* `Version`:
|
* `Version`:
|
||||||
* `MicroUtils`: `0.4.28` -> `0.4.29`
|
* `MicroUtils`: `0.4.28` -> `0.4.29`
|
||||||
|
* `Core`:
|
||||||
|
* `AdministratorChatMemberSerializer` and `ChatMemberSerializer` has changed their visibility: they are public for now
|
||||||
* `Behaviour Builder`:
|
* `Behaviour Builder`:
|
||||||
* Now content triggers and expectaters will wait for channel posts too
|
* Now content triggers and expectators will wait for channel posts too
|
||||||
|
|
||||||
## 0.32.9
|
## 0.32.9
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types.ChatMember.abstracts
|
package dev.inmo.tgbotapi.types.ChatMember.abstracts
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||||
import kotlinx.serialization.encoding.Decoder
|
import kotlinx.serialization.encoding.Decoder
|
||||||
@ -20,7 +21,8 @@ interface AdministratorChatMember : SpecialRightsChatMember {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Serializer(AdministratorChatMember::class)
|
@Serializer(AdministratorChatMember::class)
|
||||||
internal object AdministratorChatMemberSerializer : KSerializer<AdministratorChatMember> {
|
@RiskFeature
|
||||||
|
object AdministratorChatMemberSerializer : KSerializer<AdministratorChatMember> {
|
||||||
override val descriptor: SerialDescriptor = ChatMemberSerializer.descriptor
|
override val descriptor: SerialDescriptor = ChatMemberSerializer.descriptor
|
||||||
|
|
||||||
override fun deserialize(decoder: Decoder): AdministratorChatMember = ChatMemberSerializer.deserialize(decoder) as AdministratorChatMember
|
override fun deserialize(decoder: Decoder): AdministratorChatMember = ChatMemberSerializer.deserialize(decoder) as AdministratorChatMember
|
||||||
|
@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.types.ChatMember.abstracts
|
|||||||
import dev.inmo.tgbotapi.types.ChatMember.*
|
import dev.inmo.tgbotapi.types.ChatMember.*
|
||||||
import dev.inmo.tgbotapi.types.User
|
import dev.inmo.tgbotapi.types.User
|
||||||
import dev.inmo.tgbotapi.types.statusField
|
import dev.inmo.tgbotapi.types.statusField
|
||||||
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.nonstrictJsonFormat
|
import dev.inmo.tgbotapi.utils.nonstrictJsonFormat
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||||
@ -17,7 +18,8 @@ interface ChatMember {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Serializer(ChatMember::class)
|
@Serializer(ChatMember::class)
|
||||||
internal object ChatMemberSerializer : KSerializer<ChatMember> {
|
@RiskFeature
|
||||||
|
object ChatMemberSerializer : KSerializer<ChatMember> {
|
||||||
override val descriptor: SerialDescriptor = JsonObject.serializer().descriptor
|
override val descriptor: SerialDescriptor = JsonObject.serializer().descriptor
|
||||||
|
|
||||||
override fun deserialize(decoder: Decoder): ChatMember {
|
override fun deserialize(decoder: Decoder): ChatMember {
|
||||||
|
@ -35,4 +35,4 @@ const val lowLevelRiskFeatureMessage = "This method is low-level and not recomme
|
|||||||
AnnotationTarget.TYPEALIAS,
|
AnnotationTarget.TYPEALIAS,
|
||||||
AnnotationTarget.TYPE_PARAMETER
|
AnnotationTarget.TYPE_PARAMETER
|
||||||
)
|
)
|
||||||
annotation class RiskFeature(val message: String)
|
annotation class RiskFeature(val message: String = lowLevelRiskFeatureMessage)
|
||||||
|
Loading…
Reference in New Issue
Block a user