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:
parent
9c43fecf41
commit
49f7954db7
@ -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
|
||||||
|
}
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user