Table of Contents

Enum FluxerOpCode

Namespace
Fluxer.Net.Gateway
Assembly
Fluxer.Net.dll

Operation codes used in the Fluxer Gateway WebSocket protocol. These codes determine how gateway packets should be processed.

public enum FluxerOpCode

Fields

CallConnect = 13

Connects to a call (voice/video). Client → Server. Initiates call connection.

Dispatch = 0

Dispatches an event from the server to the client. Server → Client. Contains event data in the data field.

All gateway events (MESSAGE_CREATE, GUILD_UPDATE, etc.) use this opcode. The specific event type is identified by the Dispatch field.

GatewayError = 12

An error in the gateway has occured.

GuildSubscriptions = 14

Subscribes to events for specific guilds. Client → Server. Controls which guild events are received.

Used to enable or disable events for specific guilds. Useful for managing event load in bots that are in many guilds.

Heartbeat = 1

Heartbeat packet to maintain connection. Bidirectional. Client sends periodically, server may request immediate heartbeat.

Clients must send heartbeat packets at the interval specified in the HELLO event. The server responds with HeartbeatAck. Failure to heartbeat will result in disconnection.

HeartbeatAck = 11

Acknowledges receipt of a heartbeat. Server → Client. Confirms heartbeat was received.

Server sends this in response to client HEARTBEAT packets. If client does not receive ACK, the connection may be unhealthy.

Hello = 10

Initial message sent by server after connection. Server → Client. Contains heartbeat interval.

First message received after WebSocket connection is established. Contains the heartbeat interval in milliseconds that the client must use. Client should begin sending heartbeats and then send IDENTIFY or RESUME. See HelloGatewayData for payload structure.

Identify = 2

Identifies a new session and authenticates the client. Client → Server. Sent immediately after connection to authenticate.

Contains authentication token, client properties, presence, and event filters. Must be sent before any other client packets (except RESUME). See IdentifyGatewayData for payload structure.

InvalidSession = 9

Indicates the session is invalid and cannot be resumed. Server → Client. Session must be terminated and new IDENTIFY sent.

Contains a boolean indicating if the session is resumable. If false, client must clear session state and send new IDENTIFY. If true, client may attempt RESUME again.

PresenceUpdate = 3

Updates the client's presence (online status, activity). Client → Server. Changes the user's visible status.

Used to change online status (Online, Idle, Do Not Disturb, Invisible). See PresenceUpdateGatewayData for payload structure.

Reconnect = 7

Server requests the client to reconnect. Server → Client. Client should immediately reconnect and attempt RESUME.

Server is requesting a controlled reconnection (e.g., for load balancing). Client should disconnect and reconnect, attempting to RESUME the session.

RequestChannelMemberCounts = 16

Request channel member count.

RequestGuildMemberCounts = 15

Request guild member count.

RequestGuildMembers = 8

Requests guild member list for a specific guild. Client → Server. Used to fetch member information for large guilds.

For guilds with many members, not all members are sent in GUILD_CREATE. This opcode requests additional member data. Server responds with GUILD_MEMBERS_CHUNK events.

Resume = 6

Resumes a previous session after disconnection. Client → Server. Attempts to replay missed events from last sequence.

Sent instead of IDENTIFY when reconnecting with a valid session ID. Contains session ID, sequence number, and token. Server responds with RESUMED event if successful, or INVALID_SESSION if failed. See ReconnectGatewayData for payload structure.

VoiceServerPing = 5

Pings the voice server to maintain voice connection. Client → Server. Used during active voice connections.

VoiceStateUpdate = 4

Updates voice state (join/leave voice channels, mute, deafen). Client → Server. Controls voice channel participation.

Used to join or leave voice channels and update voice settings. Server responds with VOICE_STATE_UPDATE and VOICE_SERVER_UPDATE events.

Remarks

OpCodes are used in OpCode to identify the type of message being sent or received over the gateway WebSocket connection. The gateway uses these codes to route packets to appropriate handlers for events, heartbeats, authentication, and more.