glyde/event/session

The session’s own dispatches. READY decodes in glyde/ready and RESUMED carries nothing, which leaves RATE_LIMITED.

Types

Keyed by opcode. Only opcode 8’s shape is documented; a value this build has no shape for decodes as None.

pub type RateLimitMeta {
  MemberRequestMeta(
    guild_id: id.Id(id.Guild),
    nonce: option.Option(String),
  )
}

Constructors

The answer to going over a gateway send limit, today one REQUEST_GUILD_MEMBERS per guild per 30 seconds.

pub type RateLimited {
  RateLimited(
    opcode: Int,
    retry_after: Float,
    meta: option.Option(RateLimitMeta),
  )
}

Constructors

  • RateLimited(
      opcode: Int,
      retry_after: Float,
      meta: option.Option(RateLimitMeta),
    )

    Arguments

    opcode

    The send opcode that was limited. 8 today.

    retry_after

    SECONDS, fractional, and a bare 30 when the value is whole. retry_after_ms is usually what you want.

    meta

    None for any opcode this build has no meta shape for, and for a missing meta key.

Values

pub fn rate_limited_decoder() -> decode.Decoder(RateLimited)
pub fn retry_after_ms(limited: RateLimited) -> Int

retry_after in milliseconds, never negative: “retry now” is the only reading of a negative delay a host can act on. Our floor, not Discord’s.

Search Document