-
-
Notifications
You must be signed in to change notification settings - Fork 114
/
v4.ts
109 lines (107 loc) · 2.05 KB
/
v4.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
export const VoiceGatewayVersion = '4';
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
*/
export enum VoiceOPCodes {
/**
* Begin a voice websocket connection
*/
Identify,
/**
* Select the voice protocol
*/
SelectProtocol,
/**
* Complete the websocket handshake
*/
Ready,
/**
* Keep the websocket connection alive
*/
Heartbeat,
/**
* Describe the session
*/
SessionDescription,
/**
* Indicate which users are speaking
*/
Speaking,
/**
* Sent to acknowledge a received client heartbeat
*/
HeartbeatAck,
/**
* Resume a connection
*/
Resume,
/**
* Time to wait between sending heartbeats in milliseconds
*/
Hello,
/**
* Acknowledge a successful session resume
*/
Resumed,
/**
* A client has connected to the voice channel
*/
ClientConnect = 12,
/**
* A client has disconnected from the voice channel
*/
ClientDisconnect,
}
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes
*/
export enum VoiceCloseCodes {
/**
* You sent an invalid opcode
*/
UnknownOpCode = 4001,
/**
* You sent a invalid payload in your identifying to the Gateway
*/
FailedToDecode,
/**
* You sent a payload before identifying with the Gateway
*/
NotAuthenticated,
/**
* The token you sent in your identify payload is incorrect
*/
AuthenticationFailed,
/**
* You sent more than one identify payload. Stahp
*/
AlreadyAuthenticated,
/**
* Your session is no longer valid
*/
SessionNoLongerValid,
/**
* Your session has timed out
*/
SessionTimeout = 4009,
/**
* We can't find the server you're trying to connect to
*/
ServerNotFound = 4011,
/**
* We didn't recognize the protocol you sent
*/
UnknownProtocol,
/**
* Either the channel was deleted, you were kicked, or the main gateway session was dropped. Should not reconnect
*/
Disconnected = 4014,
/**
* The server crashed. Our bad! Try resuming
*/
VoiceServerCrashed,
/**
* We didn't recognize your encryption
*/
UnknownEncryptionMode,
}