1
0
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:
InsanusMokrassar 2021-03-11 16:00:47 +06:00
parent 40d702a311
commit aba62ba930
4 changed files with 10 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -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)