mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-22 16:47:13 +00:00
chatmember serializers are public
This commit is contained in:
parent
40d702a311
commit
aba62ba930
@ -5,8 +5,10 @@
|
||||
* `Common`:
|
||||
* `Version`:
|
||||
* `MicroUtils`: `0.4.28` -> `0.4.29`
|
||||
* `Core`:
|
||||
* `AdministratorChatMemberSerializer` and `ChatMemberSerializer` has changed their visibility: they are public for now
|
||||
* `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
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package dev.inmo.tgbotapi.types.ChatMember.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||
import kotlinx.serialization.encoding.Decoder
|
||||
@ -20,7 +21,8 @@ interface AdministratorChatMember : SpecialRightsChatMember {
|
||||
}
|
||||
|
||||
@Serializer(AdministratorChatMember::class)
|
||||
internal object AdministratorChatMemberSerializer : KSerializer<AdministratorChatMember> {
|
||||
@RiskFeature
|
||||
object AdministratorChatMemberSerializer : KSerializer<AdministratorChatMember> {
|
||||
override val descriptor: SerialDescriptor = ChatMemberSerializer.descriptor
|
||||
|
||||
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.User
|
||||
import dev.inmo.tgbotapi.types.statusField
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import dev.inmo.tgbotapi.utils.nonstrictJsonFormat
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||
@ -17,7 +18,8 @@ interface ChatMember {
|
||||
}
|
||||
|
||||
@Serializer(ChatMember::class)
|
||||
internal object ChatMemberSerializer : KSerializer<ChatMember> {
|
||||
@RiskFeature
|
||||
object ChatMemberSerializer : KSerializer<ChatMember> {
|
||||
override val descriptor: SerialDescriptor = JsonObject.serializer().descriptor
|
||||
|
||||
override fun deserialize(decoder: Decoder): ChatMember {
|
||||
|
@ -35,4 +35,4 @@ const val lowLevelRiskFeatureMessage = "This method is low-level and not recomme
|
||||
AnnotationTarget.TYPEALIAS,
|
||||
AnnotationTarget.TYPE_PARAMETER
|
||||
)
|
||||
annotation class RiskFeature(val message: String)
|
||||
annotation class RiskFeature(val message: String = lowLevelRiskFeatureMessage)
|
||||
|
Loading…
Reference in New Issue
Block a user