Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hello ¶
type Hello struct { HeartbeatInterval int `json:"heartbeat_interval"` // the interval (in milliseconds) the client should heartbeat with Trace []string `json:"_trace,omitempty"` // Sent from the gateway but unused & undocumented }
Hello - Sent on connection to the websocket. Defines the heartbeat interval that the client should heartbeat to.
type InvalidSession ¶
InvalidSession - Sent to indicate one of at least three different situations:
the gateway could not initialize a session after receiving an Opcode 2 Identify the gateway could not resume a previous session after receiving an Opcode 6 Resume the gateway has invalidated an active session and is requesting client action
The inner `d` key is a boolean that indicates whether the session may be resumable.
type Ready ¶
type Ready struct { V int `json:"v"` // gateway version User api.User `json:"user"` // information about the user including email Guilds []*api.UnavailableGuild `json:"guilds"` // the guilds the user is in SessionID string `json:"session_id"` // used for resuming connections ResumeGatewayURL string `json:"resume_gateway_url"` // Gateway URL for resuming connections Shard [2]int `json:"shard,omitempty"` // the shard information associated with this session, if sent when identifying Application api.Application `json:"application"` // contains id and flags }
Ready - The ready event is dispatched when a client has completed the initial handshake with the gateway (for new sessions).
The ready event can be the largest and most complex event the gateway will send, as it contains all the state required for a client to begin interacting with the rest of the platform.
`guilds` are the guilds of which your bot is a member.
They start out as unavailable when you connect to the gateway.
As they become available, your bot will be notified via Guild Create events.