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

more fixes

This commit is contained in:
InsanusMokrassar 2024-09-08 02:18:05 +06:00
parent 2e2abb8e15
commit b3dfef9a38
5 changed files with 62 additions and 2 deletions

View File

@ -12565,6 +12565,28 @@ public final class dev/inmo/tgbotapi/types/boosts/ChatBoostSource$Giveaway$Compa
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/boosts/ChatBoostSource$Giveaway$Created : dev/inmo/tgbotapi/types/boosts/ChatBoostSource$Giveaway {
public static final field Companion Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource$Giveaway$Created$Companion;
public synthetic fun <init> (JLjava/lang/Integer;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1-APLFQys ()J
public final fun component2 ()Ljava/lang/Integer;
public final fun copy-58uUwjI (JLjava/lang/Integer;)Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource$Giveaway$Created;
public static synthetic fun copy-58uUwjI$default (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource$Giveaway$Created;JLjava/lang/Integer;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource$Giveaway$Created;
public fun equals (Ljava/lang/Object;)Z
public fun getClaimed ()Z
public fun getMessageId-APLFQys ()J
public fun getPrizeStarCount ()Ljava/lang/Integer;
public fun getSourceName ()Ljava/lang/String;
public fun getUnclaimed ()Z
public fun getUser ()Ldev/inmo/tgbotapi/types/chat/PreviewUser;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final class dev/inmo/tgbotapi/types/boosts/ChatBoostSource$Giveaway$Created$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/boosts/ChatBoostSource$Giveaway$DefaultImpls {
public static fun getClaimed (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource$Giveaway;)Z
}

View File

@ -59,6 +59,27 @@ sealed interface ChatBoostSource {
get() = !unclaimed
val prizeStarCount: Int?
@Serializable(ChatBoostSource.Companion::class)
data class Created(
@SerialName(giveawayMessageIdField)
override val messageId: MessageId,
@SerialName(prizeStarCountField)
override val prizeStarCount: Int?
) : Giveaway {
@Required
@EncodeDefault
@SerialName(sourceField)
override val sourceName: String = Giveaway.sourceCode
@Required
@EncodeDefault
@SerialName(isUnclaimedField)
override val unclaimed: Boolean = false
@SerialName(userField)
@EncodeDefault
override val user: PreviewUser?
get() = null
}
@Serializable(ChatBoostSource.Companion::class)
data class Claimed(
@SerialName(giveawayMessageIdField)
@ -120,7 +141,7 @@ sealed interface ChatBoostSource {
@SerialName(giveawayMessageIdField)
val messageId: MessageId? = null,
@SerialName(isUnclaimedField)
val unclaimed: Boolean? = null,
val unclaimed: Boolean = false,
@SerialName(prizeStarCountField)
val prizeStarCount: Int? = null
)
@ -153,6 +174,10 @@ sealed interface ChatBoostSource {
surrogate.user,
surrogate.prizeStarCount
)
surrogate.user == null && surrogate.unclaimed == false -> Giveaway.Created(
surrogate.messageId,
surrogate.prizeStarCount
)
surrogate.unclaimed == true -> Giveaway.Unclaimed(
surrogate.messageId,
surrogate.prizeStarCount
@ -174,7 +199,7 @@ sealed interface ChatBoostSource {
value.sourceName,
value.user,
(value as? Giveaway) ?.messageId,
(value as? Giveaway) ?.unclaimed,
(value as? Giveaway) ?.unclaimed ?: false,
(value as? Giveaway) ?.prizeStarCount
)

View File

@ -22,6 +22,7 @@ sealed interface GiveawayCreated : ChatEvent, PublicChatEvent {
object Serializer : KSerializer<GiveawayCreated> {
@Serializable
private data class Surrogate(
@SerialName(prizeStarCountField)
val prizeStarCount: Int? = null
)

View File

@ -1263,6 +1263,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun contentOrThrow (Ldev/inmo/tgbotapi/types/ReplyInfo;)Ldev/inmo/tgbotapi/types/ReplyInfo$External$Content;
public static final fun createInvoiceLinkOrNull (Ldev/inmo/tgbotapi/abstracts/CommonSendInvoiceData;)Ldev/inmo/tgbotapi/requests/send/payments/CreateInvoiceLink;
public static final fun createInvoiceLinkOrThrow (Ldev/inmo/tgbotapi/abstracts/CommonSendInvoiceData;)Ldev/inmo/tgbotapi/requests/send/payments/CreateInvoiceLink;
public static final fun createdOrNull (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;)Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource$Giveaway$Created;
public static final fun createdOrThrow (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;)Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource$Giveaway$Created;
public static final fun cubeDiceAnimationTypeOrNull (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;)Ldev/inmo/tgbotapi/types/dice/CubeDiceAnimationType;
public static final fun cubeDiceAnimationTypeOrThrow (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;)Ldev/inmo/tgbotapi/types/dice/CubeDiceAnimationType;
public static final fun customBotActionOrNull (Ldev/inmo/tgbotapi/types/actions/BotAction;)Ldev/inmo/tgbotapi/types/actions/CustomBotAction;
@ -1576,6 +1578,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun ifContent (Ldev/inmo/tgbotapi/types/ReplyInfo;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifCreateInvoiceLink (Ldev/inmo/tgbotapi/abstracts/CommonSendInvoiceData;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifCreated (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifCubeDiceAnimationType (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifCustomBotAction (Ldev/inmo/tgbotapi/types/actions/BotAction;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifCustomDiceAnimationType (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;

View File

@ -2058,6 +2058,15 @@ public inline fun ChatBoostSource.giveawayOrThrow(): ChatBoostSource.Giveaway =
public inline fun <T> ChatBoostSource.ifGiveaway(block: (ChatBoostSource.Giveaway) -> T): T? =
giveawayOrNull() ?.let(block)
public inline fun ChatBoostSource.createdOrNull(): ChatBoostSource.Giveaway.Created? = this as?
dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway.Created
public inline fun ChatBoostSource.createdOrThrow(): ChatBoostSource.Giveaway.Created = this as
dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway.Created
public inline fun <T> ChatBoostSource.ifCreated(block: (ChatBoostSource.Giveaway.Created) -> T): T?
= createdOrNull() ?.let(block)
public inline fun ChatBoostSource.unclaimedOrNull(): ChatBoostSource.Giveaway.Unclaimed? = this as?
dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway.Unclaimed