Expand description
The gateway: opcodes, intents, close codes, payloads and events.
This module contains only data types. The connection itself lives in the djs-gateway
crate.
Modules§
- payload
- The data (
dfield) of gateway payloads.
Structs§
- Activity
- An activity: a game, stream, song, custom status, … shown in a user’s presence.
- Activity
Assets - The images of an activity and their hover texts.
- Activity
Emoji - The emoji of a custom status.
- Activity
Flags - Flags of an activity: what the activity supports (joining, spectating, …).
- Activity
Party - The player’s party.
- Activity
Secrets - The Rich Presence secrets of an activity.
- Activity
Timestamps - When an
Activitystarted and ends (both: a time bar for listening and watching). - Client
Status - A user’s status per platform;
a platform is
Nonewhen the user is offline or invisible there. - Gateway
Event Deserializer - A
DeserializeSeedthat decodes a gateway payload into aGatewayEvent. - Intents
- Gateway intents: the groups of events a client subscribes to when identifying.
- Presence
- A user’s presence: their status and activities in a guild.
- Presence
User - The partial user of a
Presence(D-074): onlyidis guaranteed; the other fields are present when they changed.Nonemeans “not sent” (ornull). - ShardId
- Identifies a shard: its number and the total number of shards.
Enums§
- Activity
Type - The kind of an activity.
- Close
Code - A gateway close event code: the reason Discord gives when it closes the WebSocket connection.
- Dispatch
Event - The event carried by a
GatewayEvent::Dispatch: every documented dispatch event, with its own payload type (D-073) frompayload. - Gateway
Event - A payload received from the gateway, decoded according to its opcode.
- OpCode
- A gateway opcode:
the
opfield of every gateway payload. - Status
- The online status of a user.
- Status
Display Type - Which field is shown as the status text in the member list.
Constants§
- API_
VERSION - The Discord API version targeted by this crate (and by discord.js v14).