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
-
MemberRequestMeta( guild_id: id.Id(id.Guild), nonce: option.Option(String), )
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
30when the value is whole.retry_after_msis usually what you want. - meta
-
Nonefor any opcode this build has no meta shape for, and for a missingmetakey.
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.