mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 09:07:12 +00:00
add support of birthdate
This commit is contained in:
parent
f47b3673a7
commit
9d506b11a3
@ -0,0 +1,19 @@
|
|||||||
|
package dev.inmo.tgbotapi.types
|
||||||
|
|
||||||
|
import korlibs.time.Date
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class Birthdate(
|
||||||
|
@SerialName(dayField)
|
||||||
|
val day: Int,
|
||||||
|
@SerialName(monthField)
|
||||||
|
val month: Int,
|
||||||
|
@SerialName(yearField)
|
||||||
|
val year: Int
|
||||||
|
) {
|
||||||
|
val date: Date by lazy {
|
||||||
|
Date(year, month, day)
|
||||||
|
}
|
||||||
|
}
|
@ -151,6 +151,7 @@ const val profileAccentColorIdField = "profile_accent_color_id"
|
|||||||
const val backgroundCustomEmojiIdField = "background_custom_emoji_id"
|
const val backgroundCustomEmojiIdField = "background_custom_emoji_id"
|
||||||
const val profileBackgroundCustomEmojiIdField = "profile_background_custom_emoji_id"
|
const val profileBackgroundCustomEmojiIdField = "profile_background_custom_emoji_id"
|
||||||
const val personalChatField = "personal_chat"
|
const val personalChatField = "personal_chat"
|
||||||
|
const val birthdateField = "birthdate"
|
||||||
const val hasVisibleHistoryField = "has_visible_history"
|
const val hasVisibleHistoryField = "has_visible_history"
|
||||||
const val unrestrictBoostsCountField = "unrestrict_boost_count"
|
const val unrestrictBoostsCountField = "unrestrict_boost_count"
|
||||||
const val customEmojiStickerSetNameField = "custom_emoji_sticker_set_name"
|
const val customEmojiStickerSetNameField = "custom_emoji_sticker_set_name"
|
||||||
@ -592,3 +593,7 @@ const val businessConnectionIdField = "business_connection_id"
|
|||||||
const val businessIntroField = "business_intro"
|
const val businessIntroField = "business_intro"
|
||||||
const val businessLocationField = "business_location"
|
const val businessLocationField = "business_location"
|
||||||
const val businessOpeningHoursField = "business_opening_hours"
|
const val businessOpeningHoursField = "business_opening_hours"
|
||||||
|
|
||||||
|
const val dayField = "day"
|
||||||
|
const val monthField = "month"
|
||||||
|
const val yearField = "year"
|
||||||
|
@ -133,6 +133,8 @@ data class ExtendedPrivateChatImpl(
|
|||||||
override val businessLocation: BusinessLocation? = null,
|
override val businessLocation: BusinessLocation? = null,
|
||||||
@SerialName(businessOpeningHoursField)
|
@SerialName(businessOpeningHoursField)
|
||||||
override val businessOpeningHours: BusinessOpeningHours? = null,
|
override val businessOpeningHours: BusinessOpeningHours? = null,
|
||||||
|
@SerialName(birthdateField)
|
||||||
|
override val birthdate: Birthdate? = null,
|
||||||
@SerialName(personalChatField)
|
@SerialName(personalChatField)
|
||||||
@Serializable(PreviewChatSerializer::class)
|
@Serializable(PreviewChatSerializer::class)
|
||||||
override val personalChat: PreviewChannelChat? = null
|
override val personalChat: PreviewChannelChat? = null
|
||||||
|
@ -46,6 +46,7 @@ sealed interface ExtendedPrivateChat : PrivateChat, ExtendedChatWithUsername, Ex
|
|||||||
val businessLocation: BusinessLocation?
|
val businessLocation: BusinessLocation?
|
||||||
val businessOpeningHours: BusinessOpeningHours?
|
val businessOpeningHours: BusinessOpeningHours?
|
||||||
|
|
||||||
|
val birthdate: Birthdate?
|
||||||
val personalChat: PreviewChannelChat?
|
val personalChat: PreviewChannelChat?
|
||||||
|
|
||||||
val allowCreateUserIdLink: Boolean
|
val allowCreateUserIdLink: Boolean
|
||||||
|
Loading…
Reference in New Issue
Block a user