1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-08 17:33:47 +00:00

add support of until in MemberChatMember

This commit is contained in:
InsanusMokrassar 2024-08-14 22:16:14 +06:00
parent 9c43fecf41
commit 49f7954db7
2 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,11 @@
package dev.inmo.tgbotapi.types.chat.member package dev.inmo.tgbotapi.types.chat.member
import dev.inmo.tgbotapi.abstracts.types.UntilDate
import korlibs.time.DateTime
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
@Serializable(ChatMemberSerializer::class) @Serializable(ChatMemberSerializer::class)
sealed interface MemberChatMember : ChatMember sealed interface MemberChatMember : ChatMember, UntilDate {
val until: DateTime?
get() = untilDate ?.asDate
}

View File

@ -2,12 +2,16 @@ package dev.inmo.tgbotapi.types.chat.member
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.chat.User
import korlibs.time.DateTime
import kotlinx.serialization.* import kotlinx.serialization.*
@Serializable @Serializable
data class MemberChatMemberImpl( data class MemberChatMemberImpl(
@SerialName(userField) @SerialName(userField)
override val user: User override val user: User,
@SerialName(untilDateField)
@Serializable(TelegramDateSerializer::class)
override val untilDate: TelegramDate? = null
) : MemberChatMember { ) : MemberChatMember {
@SerialName(statusField) @SerialName(statusField)
@Required @Required