Skip to content

Commit

Permalink
Adjust docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrasnitski committed Oct 14, 2023
1 parent 4256861 commit 51cc66d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
13 changes: 6 additions & 7 deletions src/client/event_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,20 +444,19 @@ event_handler! {
/// Provides data about the subscription.
async fn entitlement_create(&self, EntitlementCreate { ctx: Context, entitlement: Entitlement });

/// Dispatched when a user's subscription to a SKU renews for the next billing period.
/// Dispatched when a user's entitlement has been updated, such as when a subscription is
/// renewed for the next billing period.
///
/// Provides data abut the updated subscription. Specifically, the [`Entitlement::ends_at`]
/// field will have changed.
/// Provides data abut the updated subscription. If the entitlement is renewed, the
/// [`Entitlement::ends_at`] field will have changed.
async fn entitlement_update(&self, EntitlementUpdate { ctx: Context, entitlement: Entitlement });

/// Dispatched when a user's entitlement has been deleted. This happens rarely, but can occur
/// if a subscription is refunded or otherwise deleted by Discord.
/// if a subscription is refunded or otherwise deleted by Discord. Entitlements are not deleted
/// when they expire.
///
/// Provides data about the subscription. Specifically, the [`Entitlement::deleted`] field will
/// be set.
///
/// Note that expired subscriptions do not result in deletion of their corresponding
/// [`Entitlement`] and will not trigger this event upon expiring.
async fn entitlement_delete(&self, EntitlementDelete { ctx: Context, entitlement: Entitlement });

/// Dispatched when an HTTP rate limit is hit
Expand Down
2 changes: 1 addition & 1 deletion src/model/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ pub enum Event {
GuildScheduledEventUserRemove(GuildScheduledEventUserRemoveEvent),
/// A user subscribed to a SKU.
EntitlementCreate(EntitlementCreateEvent),
/// A user's subscription to a SKU renewed for the next billing period.
/// A user's entitlement was updated or renewed.
EntitlementUpdate(EntitlementUpdateEvent),
/// A user's entitlement was deleted by Discord, or refunded.
EntitlementDelete(EntitlementDeleteEvent),
Expand Down
3 changes: 2 additions & 1 deletion src/model/monetization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ pub struct Entitlement {
/// The type of the entitlement.
#[serde(rename = "type")]
pub kind: EntitlementKind,
/// Whether the entitlement has been deleted or not.
/// Whether the entitlement has been deleted or not. Entitlements are not deleted when they
/// expire.
pub deleted: bool,
/// Start date after which the entitlement is valid. Not present when using test entitlements.
pub starts_at: Option<Timestamp>,
Expand Down

0 comments on commit 51cc66d

Please sign in to comment.