1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-25 19:48:43 +00:00

add support of business info in chats

This commit is contained in:
InsanusMokrassar 2024-04-16 18:43:09 +06:00
parent cb7bb01671
commit 8de584b292
3 changed files with 19 additions and 0 deletions

View File

@ -587,3 +587,6 @@ const val wasRefundedField = "was_refunded"
const val isManualField = "is_manual" const val isManualField = "is_manual"
const val businessConnectionIdField = "business_connection_id" const val businessConnectionIdField = "business_connection_id"
const val businessIntroField = "business_intro"
const val businessLocationField = "business_location"
const val businessOpeningHoursField = "business_opening_hours"

View File

@ -1,6 +1,9 @@
package dev.inmo.tgbotapi.types.chat package dev.inmo.tgbotapi.types.chat
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessIntro
import dev.inmo.tgbotapi.types.business_connection.BusinessLocation
import dev.inmo.tgbotapi.types.business_connection.BusinessOpeningHours
import dev.inmo.tgbotapi.types.colors.ColorId import dev.inmo.tgbotapi.types.colors.ColorId
import dev.inmo.tgbotapi.types.message.abstracts.Message import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
@ -124,6 +127,12 @@ data class ExtendedPrivateChatImpl(
override val backgroundCustomEmojiId: CustomEmojiId? = null, override val backgroundCustomEmojiId: CustomEmojiId? = null,
@SerialName(profileBackgroundCustomEmojiIdField) @SerialName(profileBackgroundCustomEmojiIdField)
override val profileBackgroundCustomEmojiId: CustomEmojiId? = null, override val profileBackgroundCustomEmojiId: CustomEmojiId? = null,
@SerialName(businessIntroField)
override val businessIntro: BusinessIntro? = null,
@SerialName(businessLocationField)
override val businessLocation: BusinessLocation? = null,
@SerialName(businessOpeningHoursField)
override val businessOpeningHours: BusinessOpeningHours? = null,
) : ExtendedPrivateChat ) : ExtendedPrivateChat
typealias ExtendedUser = ExtendedPrivateChatImpl typealias ExtendedUser = ExtendedPrivateChatImpl

View File

@ -1,6 +1,9 @@
package dev.inmo.tgbotapi.types.chat package dev.inmo.tgbotapi.types.chat
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessIntro
import dev.inmo.tgbotapi.types.business_connection.BusinessLocation
import dev.inmo.tgbotapi.types.business_connection.BusinessOpeningHours
import dev.inmo.tgbotapi.types.colors.ColorId import dev.inmo.tgbotapi.types.colors.ColorId
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
import dev.inmo.tgbotapi.types.message.abstracts.Message import dev.inmo.tgbotapi.types.message.abstracts.Message
@ -39,6 +42,10 @@ sealed interface ExtendedPrivateChat : PrivateChat, ExtendedChatWithUsername, Ex
val hasPrivateForwards: Boolean val hasPrivateForwards: Boolean
val hasRestrictedVoiceAndVideoMessages: Boolean val hasRestrictedVoiceAndVideoMessages: Boolean
val businessIntro: BusinessIntro?
val businessLocation: BusinessLocation?
val businessOpeningHours: BusinessOpeningHours?
val allowCreateUserIdLink: Boolean val allowCreateUserIdLink: Boolean
get() = hasPrivateForwards get() = hasPrivateForwards
} }