Skip to content

Commit

Permalink
feat(core): Subscription.skus
Browse files Browse the repository at this point in the history
  • Loading branch information
lukellmann committed Sep 14, 2024
1 parent cdf41be commit 28923af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/api/core.api
Original file line number Diff line number Diff line change
Expand Up @@ -10959,6 +10959,7 @@ public final class dev/kord/core/entity/monetization/Subscription : dev/kord/cor
public fun getId ()Ldev/kord/common/entity/Snowflake;
public fun getKord ()Ldev/kord/core/Kord;
public final fun getSkuIds ()Ljava/util/List;
public final fun getSkus ()Ljava/util/List;
public final fun getStartsAt ()Lkotlinx/datetime/Instant;
public final fun getStatus ()Ldev/kord/common/entity/SubscriptionStatus;
public final fun getUser ()Ldev/kord/core/behavior/UserBehavior;
Expand Down
2 changes: 2 additions & 0 deletions core/api/core.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -7037,6 +7037,8 @@ final class dev.kord.core.entity.monetization/Subscription : dev.kord.core.entit
final fun <get-kord>(): dev.kord.core/Kord // dev.kord.core.entity.monetization/Subscription.kord.<get-kord>|<get-kord>(){}[0]
final val skuIds // dev.kord.core.entity.monetization/Subscription.skuIds|{}skuIds[0]
final fun <get-skuIds>(): kotlin.collections/List<dev.kord.common.entity/Snowflake> // dev.kord.core.entity.monetization/Subscription.skuIds.<get-skuIds>|<get-skuIds>(){}[0]
final val skus // dev.kord.core.entity.monetization/Subscription.skus|{}skus[0]
final fun <get-skus>(): kotlin.collections/List<dev.kord.core.behavior.monetization/SkuBehavior> // dev.kord.core.entity.monetization/Subscription.skus.<get-skus>|<get-skus>(){}[0]
final val startsAt // dev.kord.core.entity.monetization/Subscription.startsAt|{}startsAt[0]
final fun <get-startsAt>(): kotlinx.datetime/Instant // dev.kord.core.entity.monetization/Subscription.startsAt.<get-startsAt>|<get-startsAt>(){}[0]
final val status // dev.kord.core.entity.monetization/Subscription.status|{}status[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import dev.kord.common.entity.Snowflake
import dev.kord.common.entity.SubscriptionStatus
import dev.kord.core.Kord
import dev.kord.core.behavior.UserBehavior
import dev.kord.core.behavior.monetization.SkuBehavior
import dev.kord.core.behavior.monetization.SkuBehaviorImpl
import dev.kord.core.cache.data.SubscriptionData
import dev.kord.core.entity.KordEntity
import dev.kord.core.entity.User
Expand Down Expand Up @@ -31,6 +33,10 @@ public class Subscription(
/** The list of IDs of the [Sku]s subscribed to. */
public val skuIds: List<Snowflake> get() = data.skuIds

/** The list of behaviors of the [Sku]s subscribed to. */
public val skus: List<SkuBehavior>
get() = skuIds.map { skuId -> SkuBehaviorImpl(applicationId = kord.selfId, id = skuId, kord) }

/** The list of IDs of the [Entitlement]s granted for this subscription. */
public val entitlementIds: List<Snowflake> get() = data.entitlementIds

Expand Down

0 comments on commit 28923af

Please sign in to comment.