Skip to content

Commit

Permalink
chore(core): move consume above delete
Browse files Browse the repository at this point in the history
This is consistent with the ordering in Discord's docs.
  • Loading branch information
lukellmann committed Sep 14, 2024
1 parent cc36c98 commit 3f5b8a1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions core/src/commonMain/kotlin/entity/monetization/Entitlement.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ public class Entitlement(
public val isConsumed: Boolean?
get() = data.consumed.value

/**
* For One-Time Purchase consumable [Sku]s, marks this entitlement for the [user] as [consumed][isConsumed].
*
* @throws RestRequestException if something went wrong during the request.
*/
public suspend fun consume() {
kord.rest.entitlement.consumeEntitlement(applicationId, id)
}

/**
* Requests to delete this currently active test entitlement.
*
Expand All @@ -111,15 +120,6 @@ public class Entitlement(
kord.rest.entitlement.deleteTestEntitlement(applicationId, id)
}

/**
* For One-Time Purchase consumable [Sku]s, marks this entitlement for the [user] as [consumed][isConsumed].
*
* @throws RestRequestException if something went wrong during the request.
*/
public suspend fun consume() {
kord.rest.entitlement.consumeEntitlement(applicationId, id)
}

override fun equals(other: Any?): Boolean =
other is Entitlement && this.id == other.id && this.applicationId == other.applicationId

Expand Down

0 comments on commit 3f5b8a1

Please sign in to comment.