1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-21 15:53: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
import dev.inmo.tgbotapi.abstracts.types.UntilDate
import korlibs.time.DateTime
import kotlinx.serialization.Serializable
@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.chat.User
import korlibs.time.DateTime
import kotlinx.serialization.*
@Serializable
data class MemberChatMemberImpl(
@SerialName(userField)
override val user: User
override val user: User,
@SerialName(untilDateField)
@Serializable(TelegramDateSerializer::class)
override val untilDate: TelegramDate? = null
) : MemberChatMember {
@SerialName(statusField)
@Required