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
|
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// import { VoiceOPCodes } from "@fosscord/webrtc";
export enum OPCODES {
Dispatch = 0,
Heartbeat = 1,
Identify = 2,
Presence_Update = 3,
Voice_State_Update = 4,
Voice_Server_Ping = 5, // ? What is opcode 5?
Resume = 6,
Reconnect = 7,
Request_Guild_Members = 8,
Invalid_Session = 9,
Hello = 10,
Heartbeat_ACK = 11,
Guild_Sync = 12,
DM_Update = 13,
Lazy_Request = 14,
Lobby_Connect = 15,
Lobby_Disconnect = 16,
Lobby_Voice_States_Update = 17,
Stream_Create = 18,
Stream_Delete = 19,
Stream_Watch = 20,
Stream_Ping = 21,
Stream_Set_Paused = 22,
Request_Application_Commands = 24,
}
export enum CLOSECODES {
Unknown_error = 4000,
Unknown_opcode,
Decode_error,
Not_authenticated,
Authentication_failed,
Already_authenticated,
Invalid_session,
Invalid_seq,
Rate_limited,
Session_timed_out,
Invalid_shard,
Sharding_required,
Invalid_API_version,
Invalid_intent,
Disallowed_intent,
}
export interface Payload {
op: OPCODES /* | VoiceOPCodes */;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
d?: any;
s?: number;
t?: string;
}
|