grom/user

Types

pub type AvatarDecorationData {
  AvatarDecorationData(asset: String, sku_id: String)
}

Constructors

  • AvatarDecorationData(asset: String, sku_id: String)
pub type AvatarFormat {
  PngAvatar
  JpegAvatar
  WebpAvatar
  GifAvatar
}

Constructors

  • PngAvatar
  • JpegAvatar
  • WebpAvatar
  • GifAvatar
pub type BannerFormat {
  PngBanner
  JpegBanner
  WebpBanner
  GifBanner
}

Constructors

  • PngBanner
  • JpegBanner
  • WebpBanner
  • GifBanner
pub type Collectibles {
  Collectibles(nameplate: option.Option(Nameplate))
}

Constructors

pub type Flag {
  Staff
  Partner
  Hypesquad
  BugHunterLevel1
  HypesquadBravery
  HypesquadBrilliance
  HypesquadBalance
  PremiumEarlySupporter
  TeamPseudoUser
  BugHunterLevel2
  VerifiedBot
  VerifiedDeveloper
  CertifiedModerator
  BotHttpInteractions
  ActiveDeveloper
}

Constructors

  • Staff
  • Partner
  • Hypesquad
  • BugHunterLevel1
  • HypesquadBravery
  • HypesquadBrilliance
  • HypesquadBalance
  • PremiumEarlySupporter
  • TeamPseudoUser
  • BugHunterLevel2
  • VerifiedBot
  • VerifiedDeveloper
  • CertifiedModerator
  • BotHttpInteractions
  • ActiveDeveloper
pub type Nameplate {
  Nameplate(
    sku_id: String,
    asset: String,
    label: String,
    palette: String,
  )
}

Constructors

  • Nameplate(
      sku_id: String,
      asset: String,
      label: String,
      palette: String,
    )
pub type PremiumType {
  NoPremium
  NitroClassic
  Nitro
  NitroBasic
}

Constructors

  • NoPremium
  • NitroClassic
  • Nitro
  • NitroBasic
pub type PrimaryGuild {
  PrimaryGuild(
    id: option.Option(String),
    is_enabled: option.Option(Bool),
    tag: option.Option(String),
    badge_hash: option.Option(String),
  )
}

Constructors

pub type User {
  User(
    id: String,
    username: String,
    discriminator: String,
    global_name: option.Option(String),
    avatar_hash: option.Option(String),
    is_bot: option.Option(Bool),
    is_system: option.Option(Bool),
    is_mfa_enabled: option.Option(Bool),
    banner_hash: option.Option(String),
    accent_color: option.Option(Int),
    locale: option.Option(String),
    flags: option.Option(List(Flag)),
    premium_type: option.Option(PremiumType),
    public_flags: option.Option(List(Flag)),
    avatar_decoration_data: option.Option(AvatarDecorationData),
    collectibles: option.Option(Collectibles),
    primary_guild: option.Option(PrimaryGuild),
  )
}

Constructors

Values

pub fn avatar_decoration_request(
  asset asset: String,
) -> request.Request(String)

Returns a HTTP GET request to the avatar decoration as a PNG.

pub fn avatar_request(
  id id: String,
  hash avatar: String,
  format format: AvatarFormat,
) -> request.Request(String)

If format == GifAvatar and the avatar isn’t animated, will fallback to static WEBP. You can request animated WEBPs too, in which case, if it isn’t animated, it will fallback to static WEBP.

pub fn banner_request(
  id id: String,
  hash banner: String,
  format format: BannerFormat,
) -> request.Request(String)

If format == GifBanner and the banner isn’t animated, will fallback to static WEBP. You can request animated WEBPs too, in which case, if it isn’t animated, it will fallback to static WEBP.

pub fn default_avatar_request(
  index index: Int,
) -> request.Request(String)

Use index(user) to get the index. Returns the HTTP GET request to the default avatar as a PNG.

pub fn index(of user: User) -> Result(Int, Nil)

Used to get the default user avatar. If it returns an error - you got lucky - the user’s ID/discriminator somehow isn’t an integer.

Search Document