pub struct Entitlement {
pub id: EntitlementId,
pub sku_id: SkuId,
pub application_id: ApplicationId,
pub user_id: Option<UserId>,
pub kind: EntitlementKind,
pub deleted: bool,
pub starts_at: Option<Timestamp>,
pub ends_at: Option<Timestamp>,
pub guild_id: Option<GuildId>,
}
Expand description
Represents that a user or guild has access to a premium offering in the application.
Fields§
§id: EntitlementId
The ID of the entitlement.
sku_id: SkuId
The ID of the corresponding SKU.
application_id: ApplicationId
The ID of the parent application.
user_id: Option<UserId>
The ID of the user that is granted access to the SKU.
kind: EntitlementKind
The type of the entitlement.
deleted: bool
Whether the entitlement has been deleted or not. Entitlements are not deleted when they expire.
starts_at: Option<Timestamp>
Start date after which the entitlement is valid. Not present when using test entitlements.
ends_at: Option<Timestamp>
End date after which the entitlement is no longer valid. Not present when using test entitlements.
guild_id: Option<GuildId>
The ID of the guild that is granted access to the SKU.
Implementations§
Source§impl Entitlement
impl Entitlement
Sourcepub fn sku_url(&self) -> String
pub fn sku_url(&self) -> String
Returns a link to the SKU corresponding to this entitlement. See Sku::url
for details.
Sourcepub async fn list(
cache_http: impl CacheHttp,
builder: GetEntitlements,
) -> Result<Vec<Entitlement>>
pub async fn list( cache_http: impl CacheHttp, builder: GetEntitlements, ) -> Result<Vec<Entitlement>>
Returns all entitlements for the current application, active and expired.
§Errors
May error due to an invalid response from discord, or network error.
Trait Implementations§
Source§impl Clone for Entitlement
impl Clone for Entitlement
Source§fn clone(&self) -> Entitlement
fn clone(&self) -> Entitlement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more