mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-07 00:59:57 +00:00
feat: added constructor to GiftInfo
This commit is contained in:
@@ -2,25 +2,45 @@ package dev.inmo.tgbotapi.types.gifts
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.message.RawMessageEntities
|
import dev.inmo.tgbotapi.types.message.RawMessageEntities
|
||||||
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||||
|
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlin.jvm.JvmName
|
||||||
|
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class GiftInfo private constructor(
|
data class GiftInfo private constructor(
|
||||||
@SerialName(giftField)
|
@SerialName(giftField) val gift: Gift,
|
||||||
val gift: Gift,
|
@SerialName(ownedGiftIdField) val ownedGiftId: GiftId? = null,
|
||||||
@SerialName(ownedGiftIdField)
|
@SerialName(convertStarCountField) val convertStarCount: Int? = null,
|
||||||
val ownedGiftId: GiftId? = null,
|
@SerialName(prepaidUpgradeStarCountField) val prepaidUpgradeStarCount: Int? = null,
|
||||||
@SerialName(convertStarCountField)
|
@SerialName(canBeUpgradedField) val canBeUpgraded: Boolean = false,
|
||||||
val convertStarCount: Int? = null,
|
@SerialName(textField) val text: String? = null,
|
||||||
@SerialName(prepaidUpgradeStarCountField)
|
@SerialName(entitiesField) val entities: RawMessageEntities,
|
||||||
val prepaidUpgradeStarCount: Int? = null,
|
@SerialName(isPrivateField) val isPrivate: Boolean = false
|
||||||
@SerialName(canBeUpgradedField)
|
) {
|
||||||
val canBeUpgraded: Boolean = false,
|
companion object {
|
||||||
@SerialName(textField)
|
@JvmName("PublicConstructor")
|
||||||
val text: String? = null,
|
operator fun invoke(
|
||||||
@SerialName(entitiesField)
|
gift: Gift,
|
||||||
val entities: RawMessageEntities,
|
ownedGiftId: GiftId? = null,
|
||||||
@SerialName(isPrivateField)
|
convertStarCount: Int? = null,
|
||||||
val isPrivate: Boolean = false
|
prepaidUpgradeStarCount: Int? = null,
|
||||||
)
|
canBeUpgraded: Boolean = false,
|
||||||
|
text: String? = null,
|
||||||
|
textSources: TextSourcesList = emptyList(),
|
||||||
|
position: Int,
|
||||||
|
isPrivate: Boolean = false
|
||||||
|
) = GiftInfo(
|
||||||
|
gift,
|
||||||
|
ownedGiftId,
|
||||||
|
convertStarCount,
|
||||||
|
prepaidUpgradeStarCount,
|
||||||
|
canBeUpgraded,
|
||||||
|
text,
|
||||||
|
textSources.toRawMessageEntities(position),
|
||||||
|
isPrivate
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user