1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-11-29 19:05:39 +00:00

add support of pay_for_upgrade and jvmApiDump

This commit is contained in:
2025-01-03 09:01:17 +06:00
parent 9952b6c6ae
commit d211afa26a
5 changed files with 110 additions and 54 deletions

View File

@@ -28,6 +28,8 @@ data class SendGift internal constructor(
override val parseMode: ParseMode?,
@SerialName(textEntitiesField)
private val rawEntities: List<RawMessageEntity>? = null,
@SerialName(payToUpgradeField)
val upgradableToUnique: Boolean
) : SimpleRequest<Boolean>, TextedOutput {
override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text)
@@ -46,12 +48,28 @@ data class SendGift internal constructor(
userId: UserId,
giftId: GiftId,
text: String,
parseMode: ParseMode?
) : this(userId, giftId, text, parseMode, null)
parseMode: ParseMode?,
upgradableToUnique: Boolean = false
) : this(
userId = userId,
giftId = giftId,
text = text,
parseMode = parseMode,
rawEntities = null,
upgradableToUnique = upgradableToUnique
)
constructor(
userId: UserId,
giftId: GiftId,
textSources: TextSourcesList,
) : this(userId, giftId, textSources.makeSourceString(), null, textSources.toRawMessageEntities())
upgradableToUnique: Boolean = false,
) : this(
userId = userId,
giftId = giftId,
text = textSources.makeSourceString(),
parseMode = null,
rawEntities = textSources.toRawMessageEntities(),
upgradableToUnique = upgradableToUnique
)
}

View File

@@ -655,6 +655,7 @@ const val wasRefundedField = "was_refunded"
const val isManualField = "is_manual"
const val starCountField = "star_count"
const val upgradeStarCountField = "upgrade_star_count"
const val payToUpgradeField = "pay_for_upgrade"
const val paidMediaField = "paid_media"
const val businessConnectionIdField = "business_connection_id"