From d211afa26aafb827076abb6f3c62902996b3e1fe Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 3 Jan 2025 09:01:17 +0600 Subject: [PATCH] add support of pay_for_upgrade and jvmApiDump --- tgbotapi.api/api/tgbotapi.api.api | 24 ++++-- .../tgbotapi/extensions/api/gifts/SendGift.kt | 80 +++++++++++-------- tgbotapi.core/api/tgbotapi.core.api | 35 +++++--- .../inmo/tgbotapi/requests/gifts/SendGift.kt | 24 +++++- .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 1 + 5 files changed, 110 insertions(+), 54 deletions(-) diff --git a/tgbotapi.api/api/tgbotapi.api.api b/tgbotapi.api/api/tgbotapi.api.api index 411a87a9ed..420a7557e1 100644 --- a/tgbotapi.api/api/tgbotapi.api.api +++ b/tgbotapi.api/api/tgbotapi.api.api @@ -1090,14 +1090,22 @@ public final class dev/inmo/tgbotapi/extensions/api/gifts/GetAvailableGiftsKt { } public final class dev/inmo/tgbotapi/extensions/api/gifts/SendGiftKt { - public static final fun sendGift (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/gifts/Gift;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static final fun sendGift (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/gifts/Gift;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static final fun sendGift-1FWvrZc (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static final fun sendGift-4iNBclM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/gifts/Gift;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static final fun sendGift-GROm3fU (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static final fun sendGift-WnQQACc (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static final fun sendGift-xkmhVIQ (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ljava/lang/String;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static final fun sendGift-ySMgKnk (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/gifts/Gift;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun sendGift (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/gifts/Gift;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun sendGift (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/gifts/Gift;Ljava/util/List;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun sendGift$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/gifts/Gift;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static synthetic fun sendGift$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/gifts/Gift;Ljava/util/List;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun sendGift-0SDnvgk (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun sendGift-0SDnvgk$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun sendGift-1FWvrZc (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ljava/util/List;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun sendGift-1FWvrZc$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ljava/util/List;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun sendGift-CrS58cM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun sendGift-CrS58cM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun sendGift-GROm3fU (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ljava/lang/String;Ljava/util/List;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun sendGift-GROm3fU$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ljava/lang/String;Ljava/util/List;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun sendGift-VjR9mJc (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/gifts/Gift;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun sendGift-VjR9mJc$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/gifts/Gift;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun sendGift-ySMgKnk (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/gifts/Gift;Ljava/util/List;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun sendGift-ySMgKnk$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/gifts/Gift;Ljava/util/List;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; } public final class dev/inmo/tgbotapi/extensions/api/inline/SavePreparedInlineMessageKt { diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/gifts/SendGift.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/gifts/SendGift.kt index 5f044bcbe0..b86457fa70 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/gifts/SendGift.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/gifts/SendGift.kt @@ -13,13 +13,15 @@ public suspend fun TelegramBot.sendGift( userId: UserId, giftId: GiftId, text: String, - parseMode: ParseMode? + parseMode: ParseMode?, + upgradableToUnique: Boolean = false ): Boolean = execute( SendGift( - userId, - giftId, - text, - parseMode + userId = userId, + giftId = giftId, + text = text, + parseMode = parseMode, + upgradableToUnique = upgradableToUnique ) ) @@ -27,11 +29,13 @@ public suspend fun TelegramBot.sendGift( userId: UserId, giftId: GiftId, textSources: TextSourcesList, + upgradableToUnique: Boolean = false, ): Boolean = execute( SendGift( - userId, - giftId, - textSources + userId = userId, + giftId = giftId, + textSources = textSources, + upgradableToUnique = upgradableToUnique ) ) @@ -39,44 +43,52 @@ public suspend fun TelegramBot.sendGift( user: User, giftId: GiftId, text: String, - parseMode: ParseMode? + parseMode: ParseMode?, + upgradableToUnique: Boolean = false ): Boolean = sendGift( - user.id, - giftId, - text, - parseMode + userId = user.id, + giftId = giftId, + text = text, + parseMode = parseMode, + upgradableToUnique = upgradableToUnique ) public suspend fun TelegramBot.sendGift( user: User, giftId: GiftId, textSources: TextSourcesList, + upgradableToUnique: Boolean = false, ): Boolean = sendGift( - user.id, - giftId, - textSources + userId = user.id, + giftId = giftId, + textSources = textSources, + upgradableToUnique = upgradableToUnique ) public suspend fun TelegramBot.sendGift( user: UserId, gift: Gift, text: String, - parseMode: ParseMode? + parseMode: ParseMode?, + upgradableToUnique: Boolean = false ): Boolean = sendGift( - user, - gift.id, - text, - parseMode + userId = user, + giftId = gift.id, + text = text, + parseMode = parseMode, + upgradableToUnique = upgradableToUnique ) public suspend fun TelegramBot.sendGift( user: UserId, gift: Gift, textSources: TextSourcesList, + upgradableToUnique: Boolean = false, ): Boolean = sendGift( - user, - gift.id, - textSources + userId = user, + giftId = gift.id, + textSources = textSources, + upgradableToUnique = upgradableToUnique ) @@ -84,20 +96,24 @@ public suspend fun TelegramBot.sendGift( user: User, gift: Gift, text: String, - parseMode: ParseMode? + parseMode: ParseMode?, + upgradableToUnique: Boolean = false ): Boolean = sendGift( - user.id, - gift.id, - text, - parseMode + userId = user.id, + giftId = gift.id, + text = text, + parseMode = parseMode, + upgradableToUnique = upgradableToUnique ) public suspend fun TelegramBot.sendGift( user: User, gift: Gift, textSources: TextSourcesList, + upgradableToUnique: Boolean = false, ): Boolean = sendGift( - user.id, - gift.id, - textSources + userId = user.id, + giftId = gift.id, + textSources = textSources, + upgradableToUnique = upgradableToUnique ) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 02e46d5cd5..f14bef108c 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -4674,15 +4674,18 @@ public final class dev/inmo/tgbotapi/requests/gifts/GetAvailableGifts : dev/inmo public final class dev/inmo/tgbotapi/requests/gifts/SendGift : dev/inmo/tgbotapi/abstracts/TextedOutput, dev/inmo/tgbotapi/requests/abstracts/SimpleRequest { public static final field Companion Ldev/inmo/tgbotapi/requests/gifts/SendGift$Companion; - public synthetic fun (JLjava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (JLjava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Lkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (JLjava/lang/String;Ljava/util/List;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JLjava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JLjava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JLjava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZLkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JLjava/lang/String;Ljava/util/List;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JLjava/lang/String;Ljava/util/List;ZLkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1-tHkBKVM ()J public final fun component2-OyCYJok ()Ljava/lang/String; public final fun component3 ()Ljava/lang/String; public final fun component4 ()Ldev/inmo/tgbotapi/types/message/ParseMode; - public final fun copy-LbrZz8c (JLjava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;)Ldev/inmo/tgbotapi/requests/gifts/SendGift; - public static synthetic fun copy-LbrZz8c$default (Ldev/inmo/tgbotapi/requests/gifts/SendGift;JLjava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/gifts/SendGift; + public final fun component6 ()Z + public final fun copy-ekxNoiw (JLjava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;Z)Ldev/inmo/tgbotapi/requests/gifts/SendGift; + public static synthetic fun copy-ekxNoiw$default (Ldev/inmo/tgbotapi/requests/gifts/SendGift;JLjava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ZILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/gifts/SendGift; public fun equals (Ljava/lang/Object;)Z public fun getEntities ()Ljava/util/List; public final fun getGiftId-OyCYJok ()Ljava/lang/String; @@ -4691,6 +4694,7 @@ public final class dev/inmo/tgbotapi/requests/gifts/SendGift : dev/inmo/tgbotapi public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy; public fun getText ()Ljava/lang/String; public fun getTextSources ()Ljava/util/List; + public final fun getUpgradableToUnique ()Z public final fun getUserId-tHkBKVM ()J public fun hashCode ()I public fun method ()Ljava/lang/String; @@ -9115,6 +9119,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field passportField Ljava/lang/String; public static final field passportRegistrationField Ljava/lang/String; public static final field payField Ljava/lang/String; + public static final field payToUpgradeField Ljava/lang/String; public static final field payloadField Ljava/lang/String; public static final field pendingJoinRequestCountField Ljava/lang/String; public static final field pendingUpdateCountField Ljava/lang/String; @@ -9276,6 +9281,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field unspecifiedField Ljava/lang/String; public static final field untilDateField Ljava/lang/String; public static final field updateIdField Ljava/lang/String; + public static final field upgradeStarCountField Ljava/lang/String; public static final field urlField Ljava/lang/String; public static final field useIndependentChatPermissionsField Ljava/lang/String; public static final field userAdministratorRightsField Ljava/lang/String; @@ -18345,6 +18351,7 @@ public abstract interface class dev/inmo/tgbotapi/types/gifts/Gift { public abstract fun getStarCount ()I public abstract fun getSticker ()Ldev/inmo/tgbotapi/types/files/Sticker; public abstract fun getTotalCount ()Ljava/lang/Integer; + public abstract fun getUpgradeStarCount ()Ljava/lang/Integer; } public final class dev/inmo/tgbotapi/types/gifts/Gift$Companion : kotlinx/serialization/KSerializer { @@ -18358,20 +18365,23 @@ public final class dev/inmo/tgbotapi/types/gifts/Gift$Companion : kotlinx/serial public final class dev/inmo/tgbotapi/types/gifts/Gift$Limited : dev/inmo/tgbotapi/types/gifts/Gift { public static final field Companion Ldev/inmo/tgbotapi/types/gifts/Gift$Limited$Companion; - public synthetic fun (Ljava/lang/String;Ldev/inmo/tgbotapi/types/files/Sticker;IIILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ljava/lang/String;Ldev/inmo/tgbotapi/types/files/Sticker;IIILjava/lang/Integer;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ljava/lang/String;Ldev/inmo/tgbotapi/types/files/Sticker;IIILjava/lang/Integer;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1-OyCYJok ()Ljava/lang/String; public final fun component2 ()Ldev/inmo/tgbotapi/types/files/Sticker; public final fun component3 ()I public final fun component4 ()I public final fun component5 ()I - public final fun copy-dAh8QC0 (Ljava/lang/String;Ldev/inmo/tgbotapi/types/files/Sticker;III)Ldev/inmo/tgbotapi/types/gifts/Gift$Limited; - public static synthetic fun copy-dAh8QC0$default (Ldev/inmo/tgbotapi/types/gifts/Gift$Limited;Ljava/lang/String;Ldev/inmo/tgbotapi/types/files/Sticker;IIIILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/Gift$Limited; + public final fun component6 ()Ljava/lang/Integer; + public final fun copy-RpW899k (Ljava/lang/String;Ldev/inmo/tgbotapi/types/files/Sticker;IIILjava/lang/Integer;)Ldev/inmo/tgbotapi/types/gifts/Gift$Limited; + public static synthetic fun copy-RpW899k$default (Ldev/inmo/tgbotapi/types/gifts/Gift$Limited;Ljava/lang/String;Ldev/inmo/tgbotapi/types/files/Sticker;IIILjava/lang/Integer;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/Gift$Limited; public fun equals (Ljava/lang/Object;)Z public fun getId-OyCYJok ()Ljava/lang/String; public fun getRemainingCount ()Ljava/lang/Integer; public fun getStarCount ()I public fun getSticker ()Ldev/inmo/tgbotapi/types/files/Sticker; public fun getTotalCount ()Ljava/lang/Integer; + public fun getUpgradeStarCount ()Ljava/lang/Integer; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -18393,18 +18403,21 @@ public final class dev/inmo/tgbotapi/types/gifts/Gift$Limited$Companion { public final class dev/inmo/tgbotapi/types/gifts/Gift$Unlimited : dev/inmo/tgbotapi/types/gifts/Gift { public static final field Companion Ldev/inmo/tgbotapi/types/gifts/Gift$Unlimited$Companion; - public synthetic fun (Ljava/lang/String;Ldev/inmo/tgbotapi/types/files/Sticker;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ljava/lang/String;Ldev/inmo/tgbotapi/types/files/Sticker;ILjava/lang/Integer;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ljava/lang/String;Ldev/inmo/tgbotapi/types/files/Sticker;ILjava/lang/Integer;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1-OyCYJok ()Ljava/lang/String; public final fun component2 ()Ldev/inmo/tgbotapi/types/files/Sticker; public final fun component3 ()I - public final fun copy-IqAKj4o (Ljava/lang/String;Ldev/inmo/tgbotapi/types/files/Sticker;I)Ldev/inmo/tgbotapi/types/gifts/Gift$Unlimited; - public static synthetic fun copy-IqAKj4o$default (Ldev/inmo/tgbotapi/types/gifts/Gift$Unlimited;Ljava/lang/String;Ldev/inmo/tgbotapi/types/files/Sticker;IILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/Gift$Unlimited; + public final fun component4 ()Ljava/lang/Integer; + public final fun copy-Pd50qfQ (Ljava/lang/String;Ldev/inmo/tgbotapi/types/files/Sticker;ILjava/lang/Integer;)Ldev/inmo/tgbotapi/types/gifts/Gift$Unlimited; + public static synthetic fun copy-Pd50qfQ$default (Ldev/inmo/tgbotapi/types/gifts/Gift$Unlimited;Ljava/lang/String;Ldev/inmo/tgbotapi/types/files/Sticker;ILjava/lang/Integer;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/Gift$Unlimited; public fun equals (Ljava/lang/Object;)Z public fun getId-OyCYJok ()Ljava/lang/String; public fun getRemainingCount ()Ljava/lang/Integer; public fun getStarCount ()I public fun getSticker ()Ldev/inmo/tgbotapi/types/files/Sticker; public fun getTotalCount ()Ljava/lang/Integer; + public fun getUpgradeStarCount ()Ljava/lang/Integer; public fun hashCode ()I public fun toString ()Ljava/lang/String; } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/gifts/SendGift.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/gifts/SendGift.kt index b411fd8c0c..ba3c6d1556 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/gifts/SendGift.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/gifts/SendGift.kt @@ -28,6 +28,8 @@ data class SendGift internal constructor( override val parseMode: ParseMode?, @SerialName(textEntitiesField) private val rawEntities: List? = null, + @SerialName(payToUpgradeField) + val upgradableToUnique: Boolean ) : SimpleRequest, 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 + ) } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index c5bbd3ac1b..5e9c10c239 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -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"