shimmer/types/presence

Types

pub type Presence {
  Presence(
    status: PresenceStatus,
    activities: List(PresenceActivity),
    since: Option(Int),
    afk: Bool,
  )
}

Constructors

  • Presence(
      status: PresenceStatus,
      activities: List(PresenceActivity),
      since: Option(Int),
      afk: Bool,
    )
pub type PresenceActivity {
  PresenceActivity(
    name: String,
    type_: PresenceActivityType,
    url: Option(String),
    created_at: Int,
    timestamps: Option(PresenceActivityTimestamps),
    application_id: Option(String),
    details: Option(String),
    state: Option(String),
    emoji: Option(Emoji),
    party: Option(PresenceActivityParty),
    assets: Option(PresenceActivityAssets),
    secrets: Option(PresenceActivitySecrets),
    instance: Option(Bool),
    flags: Option(List(PresenceActivityFlags)),
    buttons: Option(List(PresenceActivityButton)),
  )
}

Constructors

  • PresenceActivity(
      name: String,
      type_: PresenceActivityType,
      url: Option(String),
      created_at: Int,
      timestamps: Option(PresenceActivityTimestamps),
      application_id: Option(String),
      details: Option(String),
      state: Option(String),
      emoji: Option(Emoji),
      party: Option(PresenceActivityParty),
      assets: Option(PresenceActivityAssets),
      secrets: Option(PresenceActivitySecrets),
      instance: Option(Bool),
      flags: Option(List(PresenceActivityFlags)),
      buttons: Option(List(PresenceActivityButton)),
    )
pub type PresenceActivityAssets {
  PresenceActivityAssets(
    large_image: Option(String),
    large_text: Option(String),
    small_image: Option(String),
    small_text: Option(String),
  )
}

Constructors

  • PresenceActivityAssets(
      large_image: Option(String),
      large_text: Option(String),
      small_image: Option(String),
      small_text: Option(String),
    )
pub type PresenceActivityButton {
  PresenceActivityButton(label: String, url: String)
}

Constructors

  • PresenceActivityButton(label: String, url: String)
pub type PresenceActivityFlags {
  Instace
  Join
  Spectate
  JoinRequest
  Sync
  Play
  PartyPrivacyFriends
  PartyPrivacyVoiceChannel
  Embedded
}

Constructors

  • Instace
  • Join
  • Spectate
  • JoinRequest
  • Sync
  • Play
  • PartyPrivacyFriends
  • PartyPrivacyVoiceChannel
  • Embedded
pub type PresenceActivityParty {
  PresenceActivityParty(
    id: Option(String),
    max_size: Option(Int),
    current_size: Option(Int),
  )
}

Constructors

  • PresenceActivityParty(
      id: Option(String),
      max_size: Option(Int),
      current_size: Option(Int),
    )
pub type PresenceActivitySecrets {
  PresenceActivitySecrets(
    join: Option(String),
    spectate: Option(String),
    match_: Option(String),
  )
}

Constructors

  • PresenceActivitySecrets(
      join: Option(String),
      spectate: Option(String),
      match_: Option(String),
    )
pub type PresenceActivityTimestamps {
  PresenceActivityTimestamps(
    start: Option(Int),
    end: Option(Int),
  )
}

Constructors

  • PresenceActivityTimestamps(start: Option(Int), end: Option(Int))
pub type PresenceActivityType {
  Game
  Streaming
  Listening
  Custom
  Competing
}

Constructors

  • Game

    Game

  • Streaming

    Streaming

  • Listening

    Listening to Spotify

  • Custom

    Custom status

  • Competing

    Competing in a game

The status used in a Presence

pub type PresenceStatus {
  Online
  DoNotDisturb
  Idle
  Invisible
  Offline
}

Constructors

  • Online

    Online

  • DoNotDisturb

    Do Not Disturb

  • Idle

    AFK

  • Invisible

    Invisible and shown as offline

  • Offline

    Offline

Functions

pub fn presence_activity_flag_to_int(flag: PresenceActivityFlags) -> Int
pub fn presence_activity_flags_to_int(flags: List(
    PresenceActivityFlags,
  )) -> Int
pub fn to_map(self: Presence) -> Map(String, Dynamic)
Search Document