grom/entitlement

An Entitlement is something a user is entitled to have. Crazy, right?

An example of an entitlement is the license key for the premium version of your bot. See SKU.

Types

pub type Entitlement {
  Entitlement(
    id: String,
    sku_id: String,
    application_id: String,
    user_id: option.Option(String),
    type_: Type,
    is_deleted: Bool,
    starts_at: option.Option(timestamp.Timestamp),
    ends_at: option.Option(timestamp.Timestamp),
    guild_id: option.Option(String),
    is_consumed: option.Option(Bool),
  )
}

Constructors

pub type OwnerType {
  GuildOwner
  UserOwner
}

Constructors

  • GuildOwner
  • UserOwner
pub type Type {
  Purchase
  PremiumSubscription
  DeveloperGift
  TestModePurchase
  FreePurchase
  UserGift
  PremiumPurchase
  ApplicationSubscription
}

Constructors

  • Purchase
  • PremiumSubscription
  • DeveloperGift
  • TestModePurchase
  • FreePurchase
  • UserGift
  • PremiumPurchase
  • ApplicationSubscription

Values

pub fn consume(
  client: grom.Client,
  for application_id: String,
  id entitlement_id: String,
) -> Result(Nil, grom.Error)
pub fn create_test(
  client: grom.Client,
  for application_id: String,
  sku sku_id: String,
  to owner_id: String,
  owner_is owner_type: OwnerType,
) -> Result(Entitlement, grom.Error)
pub fn delete_test(
  client: grom.Client,
  for application_id: String,
  id entitlement_id: String,
) -> Result(Nil, grom.Error)
pub fn get(
  client: grom.Client,
  for application_id: String,
  id entitlement_id: String,
) -> Result(Entitlement, grom.Error)
Search Document