DiscordPHP Documentation

Op
in package

Contains constants used in websockets.

Tags
link
https://discord.com/developers/docs/topics/opcodes-and-status-codes
since
3.2.1

Table of Contents

CLOSE_ABNORMAL  = 1006
Abnormal close.
CLOSE_DISALLOWED_INTENTS  = 4014
Disallowed intents.
CLOSE_INVALID_INTENTS  = 4013
Invalid intents.
CLOSE_INVALID_MESSAGE  = 4002
Invalid message was sent.
CLOSE_INVALID_OPCODE  = 4001
Unknown opcode was went.
CLOSE_INVALID_SEQ  = 4007
Invalid RESUME sequence.
CLOSE_INVALID_SESSION  = 4006
Session is invalid.
CLOSE_INVALID_SHARD  = 4010
Invalid shard.
CLOSE_INVALID_TOKEN  = 4004
Invalid token on IDENTIFY.
CLOSE_INVALID_VERSION  = 4012
Invalid API version.
CLOSE_NORMAL  = 1000
Normal close or heartbeat is invalid.
CLOSE_NOT_AUTHENTICATED  = 4003
Not authenticated.
CLOSE_SESSION_TIMEOUT  = 4009
Session timeout.
CLOSE_SHARDING_REQUIRED  = 4011
Sharding requred.
CLOSE_TOO_MANY_MSG  = 4008
Too many messages sent.
CLOSE_UNKNOWN_ERROR  = 4000
Unknown error.
CLOSE_VOICE_DISCONNECTED  = 4014
Disconnected from channel.
CLOSE_VOICE_SERVER_CRASH  = 4015
Voice server crashed.
CLOSE_VOICE_SERVER_NOT_FOUND  = 4011
Can't find the server.
CLOSE_VOICE_UNKNOWN_ENCRYPT  = 4016
Unknown encryption mode.
CLOSE_VOICE_UNKNOWN_PROTO  = 4012
Unknown protocol.
CONST_ALREADY_AUTHD  = 4005
Already authenticated.
OP_DISPATCH  = 0
Dispatches an event.
OP_GUILD_MEMBER_CHUNK  = 8
Used to request member chunks.
OP_HEARTBEAT  = 1
Used for ping checking.
OP_HEARTBEAT_ACK  = 11
Used to acknowledge heartbeats.
OP_HELLO  = 10
Used to pass through the heartbeat interval.
OP_IDENTIFY  = 2
Used for client handshake.
OP_INVALID_SESSION  = 9
Used to notify clients when they have an invalid session.
OP_PRESENCE_UPDATE  = 3
Used to update the client presence.
OP_RECONNECT  = 7
Used to redirect clients to a new gateway.
OP_RESUME  = 6
Used to resume a closed connection.
OP_VOICE_SERVER_PING  = 5
Used for voice ping checking.
OP_VOICE_STATE_UPDATE  = 4
Used to join/move/leave voice channels.
VOICE_CLIENT_DISCONNECT  = 13
A client has disconnected from the voice channel.
VOICE_DESCRIPTION  = 4
Used to describe the session.
VOICE_HEARTBEAT  = 3
Used to keep the WebSocket connection alive.
VOICE_HEARTBEAT_ACK  = 6
Sent by the Discord servers to acknowledge heartbeat
VOICE_HELLO  = 8
Hello packet used to pass heartbeat interval
VOICE_IDENTIFY  = 0
Used to begin a voice WebSocket connection.
VOICE_READY  = 2
Used to complete the WebSocket handshake.
VOICE_RESUME  = 7
Resume a connection.
VOICE_RESUMED  = 9
Acknowledge a successful session resume.
VOICE_SELECT_PROTO  = 1
Used to select the voice protocol.
VOICE_SPEAKING  = 5
Used to identify which users are speaking.
getCriticalCloseCodes()  : array<string|int, mixed>
Returns the critical event codes that we should not reconnect after.
getCriticalVoiceCloseCodes()  : array<string|int, mixed>
Returns the critical event codes for a voice websocket.

Constants

CLOSE_ABNORMAL

Abnormal close.

public mixed CLOSE_ABNORMAL = 1006

CLOSE_DISALLOWED_INTENTS

Disallowed intents.

public mixed CLOSE_DISALLOWED_INTENTS = 4014

CLOSE_INVALID_INTENTS

Invalid intents.

public mixed CLOSE_INVALID_INTENTS = 4013

CLOSE_INVALID_MESSAGE

Invalid message was sent.

public mixed CLOSE_INVALID_MESSAGE = 4002

CLOSE_INVALID_OPCODE

Unknown opcode was went.

public mixed CLOSE_INVALID_OPCODE = 4001

CLOSE_INVALID_SEQ

Invalid RESUME sequence.

public mixed CLOSE_INVALID_SEQ = 4007

CLOSE_INVALID_SESSION

Session is invalid.

public mixed CLOSE_INVALID_SESSION = 4006

CLOSE_INVALID_SHARD

Invalid shard.

public mixed CLOSE_INVALID_SHARD = 4010

CLOSE_INVALID_TOKEN

Invalid token on IDENTIFY.

public mixed CLOSE_INVALID_TOKEN = 4004

CLOSE_INVALID_VERSION

Invalid API version.

public mixed CLOSE_INVALID_VERSION = 4012

CLOSE_NORMAL

Normal close or heartbeat is invalid.

public mixed CLOSE_NORMAL = 1000

CLOSE_NOT_AUTHENTICATED

Not authenticated.

public mixed CLOSE_NOT_AUTHENTICATED = 4003

CLOSE_SESSION_TIMEOUT

Session timeout.

public mixed CLOSE_SESSION_TIMEOUT = 4009

CLOSE_SHARDING_REQUIRED

Sharding requred.

public mixed CLOSE_SHARDING_REQUIRED = 4011

CLOSE_TOO_MANY_MSG

Too many messages sent.

public mixed CLOSE_TOO_MANY_MSG = 4008

CLOSE_UNKNOWN_ERROR

Unknown error.

public mixed CLOSE_UNKNOWN_ERROR = 4000

CLOSE_VOICE_DISCONNECTED

Disconnected from channel.

public mixed CLOSE_VOICE_DISCONNECTED = 4014

CLOSE_VOICE_SERVER_CRASH

Voice server crashed.

public mixed CLOSE_VOICE_SERVER_CRASH = 4015

CLOSE_VOICE_SERVER_NOT_FOUND

Can't find the server.

public mixed CLOSE_VOICE_SERVER_NOT_FOUND = 4011

CLOSE_VOICE_UNKNOWN_ENCRYPT

Unknown encryption mode.

public mixed CLOSE_VOICE_UNKNOWN_ENCRYPT = 4016

CLOSE_VOICE_UNKNOWN_PROTO

Unknown protocol.

public mixed CLOSE_VOICE_UNKNOWN_PROTO = 4012

CONST_ALREADY_AUTHD

Already authenticated.

public mixed CONST_ALREADY_AUTHD = 4005

OP_DISPATCH

Dispatches an event.

public mixed OP_DISPATCH = 0

OP_GUILD_MEMBER_CHUNK

Used to request member chunks.

public mixed OP_GUILD_MEMBER_CHUNK = 8

OP_HEARTBEAT

Used for ping checking.

public mixed OP_HEARTBEAT = 1

OP_HEARTBEAT_ACK

Used to acknowledge heartbeats.

public mixed OP_HEARTBEAT_ACK = 11

OP_HELLO

Used to pass through the heartbeat interval.

public mixed OP_HELLO = 10

OP_IDENTIFY

Used for client handshake.

public mixed OP_IDENTIFY = 2

OP_INVALID_SESSION

Used to notify clients when they have an invalid session.

public mixed OP_INVALID_SESSION = 9

OP_PRESENCE_UPDATE

Used to update the client presence.

public mixed OP_PRESENCE_UPDATE = 3

OP_RECONNECT

Used to redirect clients to a new gateway.

public mixed OP_RECONNECT = 7

OP_RESUME

Used to resume a closed connection.

public mixed OP_RESUME = 6

OP_VOICE_SERVER_PING

Used for voice ping checking.

public mixed OP_VOICE_SERVER_PING = 5

OP_VOICE_STATE_UPDATE

Used to join/move/leave voice channels.

public mixed OP_VOICE_STATE_UPDATE = 4

VOICE_CLIENT_DISCONNECT

A client has disconnected from the voice channel.

public mixed VOICE_CLIENT_DISCONNECT = 13

VOICE_DESCRIPTION

Used to describe the session.

public mixed VOICE_DESCRIPTION = 4

VOICE_HEARTBEAT

Used to keep the WebSocket connection alive.

public mixed VOICE_HEARTBEAT = 3

VOICE_HEARTBEAT_ACK

Sent by the Discord servers to acknowledge heartbeat

public mixed VOICE_HEARTBEAT_ACK = 6

VOICE_HELLO

Hello packet used to pass heartbeat interval

public mixed VOICE_HELLO = 8

VOICE_IDENTIFY

Used to begin a voice WebSocket connection.

public mixed VOICE_IDENTIFY = 0

VOICE_READY

Used to complete the WebSocket handshake.

public mixed VOICE_READY = 2

VOICE_RESUME

Resume a connection.

public mixed VOICE_RESUME = 7

VOICE_RESUMED

Acknowledge a successful session resume.

public mixed VOICE_RESUMED = 9

VOICE_SELECT_PROTO

Used to select the voice protocol.

public mixed VOICE_SELECT_PROTO = 1

VOICE_SPEAKING

Used to identify which users are speaking.

public mixed VOICE_SPEAKING = 5

Methods

getCriticalCloseCodes()

Returns the critical event codes that we should not reconnect after.

public static getCriticalCloseCodes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getCriticalVoiceCloseCodes()

Returns the critical event codes for a voice websocket.

public static getCriticalVoiceCloseCodes() : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results