@fluxerjs/core 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/dist/Channel-HM2UY4DN.mjs +17 -0
- package/dist/Channel-TOAQGSRX.mjs +17 -0
- package/dist/ClientUser-RNDKHQ3Z.mjs +9 -0
- package/dist/Guild-36EGAAEW.mjs +8 -0
- package/dist/Guild-GOQZ7XP4.mjs +8 -0
- package/dist/GuildMember-RGVPVUAG.mjs +9 -0
- package/dist/Message-23Z3RPCZ.mjs +9 -0
- package/dist/Message-XB5WNMHL.mjs +9 -0
- package/dist/chunk-6CEMF2LO.mjs +14 -0
- package/dist/chunk-6EBNOON4.mjs +86 -0
- package/dist/chunk-7H3TKJUT.mjs +53 -0
- package/dist/chunk-F2EEQP5O.mjs +86 -0
- package/dist/chunk-GUNWHOQO.mjs +42 -0
- package/dist/chunk-HQMYRYMY.mjs +6 -0
- package/dist/chunk-LBBIQOSH.mjs +53 -0
- package/dist/chunk-P4IRDGB4.mjs +43 -0
- package/dist/chunk-TE5IC7IP.mjs +36 -0
- package/dist/chunk-WFONGZGK.mjs +42 -0
- package/dist/chunk-XNS4O6QJ.mjs +7 -0
- package/dist/index.d.mts +228 -0
- package/dist/index.d.ts +228 -0
- package/dist/index.js +665 -0
- package/dist/index.mjs +329 -0
- package/package.json +41 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import * as _fluxerjs_types from '@fluxerjs/types';
|
|
2
|
+
import { APIUserPartial, APIMessageAttachment, APIMessage, APIEmbed, ChannelType, APIChannelPartial, APIChannel, APIGuild, APIGuildMember, GatewaySendPayload, Routes, GatewayVoiceStateUpdateDispatchData, GatewayVoiceServerUpdateDispatchData } from '@fluxerjs/types';
|
|
3
|
+
export { GatewayOpcodes, Routes } from '@fluxerjs/types';
|
|
4
|
+
import { Collection } from '@fluxerjs/collection';
|
|
5
|
+
import { EventEmitter } from 'events';
|
|
6
|
+
import { REST } from '@fluxerjs/rest';
|
|
7
|
+
import { WebSocketManager } from '@fluxerjs/ws';
|
|
8
|
+
export { AttachmentBuilder, EmbedBuilder, MessagePayload } from '@fluxerjs/builders';
|
|
9
|
+
|
|
10
|
+
declare abstract class Base {
|
|
11
|
+
abstract readonly client: Client;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare class User extends Base {
|
|
15
|
+
readonly client: Client;
|
|
16
|
+
readonly id: string;
|
|
17
|
+
username: string;
|
|
18
|
+
discriminator: string;
|
|
19
|
+
globalName: string | null;
|
|
20
|
+
avatar: string | null;
|
|
21
|
+
readonly bot: boolean;
|
|
22
|
+
constructor(client: Client, data: APIUserPartial);
|
|
23
|
+
avatarURL(options?: {
|
|
24
|
+
size?: number;
|
|
25
|
+
extension?: string;
|
|
26
|
+
}): string | null;
|
|
27
|
+
displayAvatarURL(options?: {
|
|
28
|
+
size?: number;
|
|
29
|
+
}): string;
|
|
30
|
+
toString(): string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare class Message extends Base {
|
|
34
|
+
readonly client: Client;
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly channelId: string;
|
|
37
|
+
readonly guildId: string | null;
|
|
38
|
+
readonly author: User;
|
|
39
|
+
content: string;
|
|
40
|
+
readonly createdAt: Date;
|
|
41
|
+
readonly editedAt: Date | null;
|
|
42
|
+
pinned: boolean;
|
|
43
|
+
readonly attachments: Collection<string, APIMessageAttachment>;
|
|
44
|
+
channel?: Channel;
|
|
45
|
+
constructor(client: Client, data: APIMessage);
|
|
46
|
+
reply(options: string | {
|
|
47
|
+
content?: string;
|
|
48
|
+
embeds?: APIEmbed[];
|
|
49
|
+
}): Promise<Message>;
|
|
50
|
+
edit(options: {
|
|
51
|
+
content?: string;
|
|
52
|
+
}): Promise<Message>;
|
|
53
|
+
delete(): Promise<void>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare abstract class Channel extends Base {
|
|
57
|
+
readonly client: Client;
|
|
58
|
+
readonly id: string;
|
|
59
|
+
type: ChannelType;
|
|
60
|
+
constructor(client: Client, data: APIChannelPartial);
|
|
61
|
+
static from(client: Client, data: APIChannel | APIChannelPartial): GuildChannel | TextChannel | null;
|
|
62
|
+
}
|
|
63
|
+
declare class GuildChannel extends Channel {
|
|
64
|
+
readonly guildId: string;
|
|
65
|
+
name: string | null;
|
|
66
|
+
position?: number;
|
|
67
|
+
parentId: string | null;
|
|
68
|
+
constructor(client: Client, data: APIChannel);
|
|
69
|
+
}
|
|
70
|
+
declare class TextChannel extends GuildChannel {
|
|
71
|
+
topic?: string | null;
|
|
72
|
+
nsfw?: boolean;
|
|
73
|
+
rateLimitPerUser?: number;
|
|
74
|
+
lastMessageId?: string | null;
|
|
75
|
+
constructor(client: Client, data: APIChannel);
|
|
76
|
+
send(options: string | {
|
|
77
|
+
content?: string;
|
|
78
|
+
embeds?: unknown[];
|
|
79
|
+
}): Promise<Message>;
|
|
80
|
+
}
|
|
81
|
+
declare class CategoryChannel extends GuildChannel {
|
|
82
|
+
}
|
|
83
|
+
declare class VoiceChannel extends GuildChannel {
|
|
84
|
+
bitrate?: number | null;
|
|
85
|
+
userLimit?: number | null;
|
|
86
|
+
rtcRegion?: string | null;
|
|
87
|
+
constructor(client: Client, data: APIChannel);
|
|
88
|
+
}
|
|
89
|
+
declare class LinkChannel extends GuildChannel {
|
|
90
|
+
url?: string | null;
|
|
91
|
+
constructor(client: Client, data: APIChannel);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare class Guild extends Base {
|
|
95
|
+
readonly client: Client;
|
|
96
|
+
readonly id: string;
|
|
97
|
+
name: string;
|
|
98
|
+
icon: string | null;
|
|
99
|
+
banner: string | null;
|
|
100
|
+
readonly ownerId: string;
|
|
101
|
+
members: Collection<string, GuildMember>;
|
|
102
|
+
channels: Collection<string, GuildChannel>;
|
|
103
|
+
constructor(client: Client, data: APIGuild);
|
|
104
|
+
iconURL(options?: {
|
|
105
|
+
size?: number;
|
|
106
|
+
}): string | null;
|
|
107
|
+
bannerURL(options?: {
|
|
108
|
+
size?: number;
|
|
109
|
+
}): string | null;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
declare class GuildMember extends Base {
|
|
113
|
+
readonly client: Client;
|
|
114
|
+
readonly id: string;
|
|
115
|
+
readonly user: User;
|
|
116
|
+
readonly guild: Guild;
|
|
117
|
+
nick: string | null;
|
|
118
|
+
readonly roles: string[];
|
|
119
|
+
readonly joinedAt: Date;
|
|
120
|
+
communicationDisabledUntil: Date | null;
|
|
121
|
+
constructor(client: Client, data: APIGuildMember & {
|
|
122
|
+
guild_id?: string;
|
|
123
|
+
}, guild: Guild);
|
|
124
|
+
get displayName(): string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
interface ClientOptions {
|
|
128
|
+
rest?: Partial<ConstructorParameters<typeof REST>[0]>;
|
|
129
|
+
intents?: number;
|
|
130
|
+
/** Optional WebSocket constructor (e.g. `require('ws')` in Node for compatibility) */
|
|
131
|
+
WebSocket?: new (url: string) => {
|
|
132
|
+
send(data: string | ArrayBufferLike): void;
|
|
133
|
+
close(code?: number): void;
|
|
134
|
+
readyState: number;
|
|
135
|
+
addEventListener?(type: string, listener: (e: unknown) => void): void;
|
|
136
|
+
on?(event: string, cb: (data?: unknown) => void): void;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
declare class ClientUser extends User {
|
|
141
|
+
readonly client: Client;
|
|
142
|
+
constructor(client: Client, data: APIUserPartial);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
declare const Events: {
|
|
146
|
+
readonly Ready: "ready";
|
|
147
|
+
readonly MessageCreate: "messageCreate";
|
|
148
|
+
readonly MessageUpdate: "messageUpdate";
|
|
149
|
+
readonly MessageDelete: "messageDelete";
|
|
150
|
+
readonly InteractionCreate: "interactionCreate";
|
|
151
|
+
readonly GuildCreate: "guildCreate";
|
|
152
|
+
readonly GuildUpdate: "guildUpdate";
|
|
153
|
+
readonly GuildDelete: "guildDelete";
|
|
154
|
+
readonly ChannelCreate: "channelCreate";
|
|
155
|
+
readonly ChannelUpdate: "channelUpdate";
|
|
156
|
+
readonly ChannelDelete: "channelDelete";
|
|
157
|
+
readonly GuildMemberAdd: "guildMemberAdd";
|
|
158
|
+
readonly GuildMemberUpdate: "guildMemberUpdate";
|
|
159
|
+
readonly GuildMemberRemove: "guildMemberRemove";
|
|
160
|
+
readonly VoiceStateUpdate: "voiceStateUpdate";
|
|
161
|
+
readonly VoiceServerUpdate: "voiceServerUpdate";
|
|
162
|
+
readonly VoiceStatesSync: "voiceStatesSync";
|
|
163
|
+
readonly Error: "error";
|
|
164
|
+
readonly Debug: "debug";
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
interface ClientEvents {
|
|
168
|
+
[Events.Ready]: [];
|
|
169
|
+
[Events.MessageCreate]: [message: Message];
|
|
170
|
+
[Events.MessageUpdate]: [oldMessage: Message | null, newMessage: Message];
|
|
171
|
+
[Events.MessageDelete]: [message: Message | {
|
|
172
|
+
id: string;
|
|
173
|
+
channelId: string;
|
|
174
|
+
}];
|
|
175
|
+
[Events.InteractionCreate]: [interaction: _fluxerjs_types.APIApplicationCommandInteraction];
|
|
176
|
+
[Events.GuildCreate]: [guild: Guild];
|
|
177
|
+
[Events.GuildUpdate]: [oldGuild: Guild, newGuild: Guild];
|
|
178
|
+
[Events.GuildDelete]: [guild: Guild];
|
|
179
|
+
[Events.ChannelCreate]: [channel: GuildChannel];
|
|
180
|
+
[Events.ChannelUpdate]: [oldChannel: Channel, newChannel: Channel];
|
|
181
|
+
[Events.ChannelDelete]: [channel: Channel];
|
|
182
|
+
[Events.GuildMemberAdd]: [member: GuildMember];
|
|
183
|
+
[Events.GuildMemberUpdate]: [oldMember: GuildMember, newMember: GuildMember];
|
|
184
|
+
[Events.GuildMemberRemove]: [member: GuildMember];
|
|
185
|
+
[Events.VoiceStateUpdate]: [data: GatewayVoiceStateUpdateDispatchData];
|
|
186
|
+
[Events.VoiceServerUpdate]: [data: GatewayVoiceServerUpdateDispatchData];
|
|
187
|
+
[Events.VoiceStatesSync]: [data: {
|
|
188
|
+
guildId: string;
|
|
189
|
+
voiceStates: Array<{
|
|
190
|
+
user_id: string;
|
|
191
|
+
channel_id: string | null;
|
|
192
|
+
}>;
|
|
193
|
+
}];
|
|
194
|
+
[Events.Error]: [error: Error];
|
|
195
|
+
[Events.Debug]: [message: string];
|
|
196
|
+
}
|
|
197
|
+
declare class Client extends EventEmitter {
|
|
198
|
+
readonly options: ClientOptions;
|
|
199
|
+
readonly rest: REST;
|
|
200
|
+
readonly guilds: Collection<string, Guild>;
|
|
201
|
+
readonly channels: Collection<string, Channel>;
|
|
202
|
+
readonly users: Collection<string, User>;
|
|
203
|
+
user: ClientUser | null;
|
|
204
|
+
readyAt: Date | null;
|
|
205
|
+
private _ws;
|
|
206
|
+
constructor(options?: ClientOptions);
|
|
207
|
+
get ws(): WebSocketManager;
|
|
208
|
+
/** Send a payload to the gateway (e.g. Voice State Update). Uses shard 0 when single-shard. */
|
|
209
|
+
sendToGateway(shardId: number, payload: GatewaySendPayload): void;
|
|
210
|
+
private handleDispatch;
|
|
211
|
+
login(token: string): Promise<string>;
|
|
212
|
+
destroy(): Promise<void>;
|
|
213
|
+
isReady(): this is Client & {
|
|
214
|
+
user: NonNullable<Client['user']>;
|
|
215
|
+
};
|
|
216
|
+
static get Routes(): typeof Routes;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
declare class FluxerError extends Error {
|
|
220
|
+
constructor(message: string);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
declare const ErrorCodes: {
|
|
224
|
+
readonly ClientNotReady: "CLIENT_NOT_READY";
|
|
225
|
+
readonly InvalidToken: "INVALID_TOKEN";
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
export { Base, CategoryChannel, Channel, Client, type ClientEvents, ClientUser, ErrorCodes, Events, FluxerError, Guild, GuildChannel, GuildMember, LinkChannel, Message, TextChannel, User, VoiceChannel };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import * as _fluxerjs_types from '@fluxerjs/types';
|
|
2
|
+
import { APIUserPartial, APIMessageAttachment, APIMessage, APIEmbed, ChannelType, APIChannelPartial, APIChannel, APIGuild, APIGuildMember, GatewaySendPayload, Routes, GatewayVoiceStateUpdateDispatchData, GatewayVoiceServerUpdateDispatchData } from '@fluxerjs/types';
|
|
3
|
+
export { GatewayOpcodes, Routes } from '@fluxerjs/types';
|
|
4
|
+
import { Collection } from '@fluxerjs/collection';
|
|
5
|
+
import { EventEmitter } from 'events';
|
|
6
|
+
import { REST } from '@fluxerjs/rest';
|
|
7
|
+
import { WebSocketManager } from '@fluxerjs/ws';
|
|
8
|
+
export { AttachmentBuilder, EmbedBuilder, MessagePayload } from '@fluxerjs/builders';
|
|
9
|
+
|
|
10
|
+
declare abstract class Base {
|
|
11
|
+
abstract readonly client: Client;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare class User extends Base {
|
|
15
|
+
readonly client: Client;
|
|
16
|
+
readonly id: string;
|
|
17
|
+
username: string;
|
|
18
|
+
discriminator: string;
|
|
19
|
+
globalName: string | null;
|
|
20
|
+
avatar: string | null;
|
|
21
|
+
readonly bot: boolean;
|
|
22
|
+
constructor(client: Client, data: APIUserPartial);
|
|
23
|
+
avatarURL(options?: {
|
|
24
|
+
size?: number;
|
|
25
|
+
extension?: string;
|
|
26
|
+
}): string | null;
|
|
27
|
+
displayAvatarURL(options?: {
|
|
28
|
+
size?: number;
|
|
29
|
+
}): string;
|
|
30
|
+
toString(): string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare class Message extends Base {
|
|
34
|
+
readonly client: Client;
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly channelId: string;
|
|
37
|
+
readonly guildId: string | null;
|
|
38
|
+
readonly author: User;
|
|
39
|
+
content: string;
|
|
40
|
+
readonly createdAt: Date;
|
|
41
|
+
readonly editedAt: Date | null;
|
|
42
|
+
pinned: boolean;
|
|
43
|
+
readonly attachments: Collection<string, APIMessageAttachment>;
|
|
44
|
+
channel?: Channel;
|
|
45
|
+
constructor(client: Client, data: APIMessage);
|
|
46
|
+
reply(options: string | {
|
|
47
|
+
content?: string;
|
|
48
|
+
embeds?: APIEmbed[];
|
|
49
|
+
}): Promise<Message>;
|
|
50
|
+
edit(options: {
|
|
51
|
+
content?: string;
|
|
52
|
+
}): Promise<Message>;
|
|
53
|
+
delete(): Promise<void>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare abstract class Channel extends Base {
|
|
57
|
+
readonly client: Client;
|
|
58
|
+
readonly id: string;
|
|
59
|
+
type: ChannelType;
|
|
60
|
+
constructor(client: Client, data: APIChannelPartial);
|
|
61
|
+
static from(client: Client, data: APIChannel | APIChannelPartial): GuildChannel | TextChannel | null;
|
|
62
|
+
}
|
|
63
|
+
declare class GuildChannel extends Channel {
|
|
64
|
+
readonly guildId: string;
|
|
65
|
+
name: string | null;
|
|
66
|
+
position?: number;
|
|
67
|
+
parentId: string | null;
|
|
68
|
+
constructor(client: Client, data: APIChannel);
|
|
69
|
+
}
|
|
70
|
+
declare class TextChannel extends GuildChannel {
|
|
71
|
+
topic?: string | null;
|
|
72
|
+
nsfw?: boolean;
|
|
73
|
+
rateLimitPerUser?: number;
|
|
74
|
+
lastMessageId?: string | null;
|
|
75
|
+
constructor(client: Client, data: APIChannel);
|
|
76
|
+
send(options: string | {
|
|
77
|
+
content?: string;
|
|
78
|
+
embeds?: unknown[];
|
|
79
|
+
}): Promise<Message>;
|
|
80
|
+
}
|
|
81
|
+
declare class CategoryChannel extends GuildChannel {
|
|
82
|
+
}
|
|
83
|
+
declare class VoiceChannel extends GuildChannel {
|
|
84
|
+
bitrate?: number | null;
|
|
85
|
+
userLimit?: number | null;
|
|
86
|
+
rtcRegion?: string | null;
|
|
87
|
+
constructor(client: Client, data: APIChannel);
|
|
88
|
+
}
|
|
89
|
+
declare class LinkChannel extends GuildChannel {
|
|
90
|
+
url?: string | null;
|
|
91
|
+
constructor(client: Client, data: APIChannel);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare class Guild extends Base {
|
|
95
|
+
readonly client: Client;
|
|
96
|
+
readonly id: string;
|
|
97
|
+
name: string;
|
|
98
|
+
icon: string | null;
|
|
99
|
+
banner: string | null;
|
|
100
|
+
readonly ownerId: string;
|
|
101
|
+
members: Collection<string, GuildMember>;
|
|
102
|
+
channels: Collection<string, GuildChannel>;
|
|
103
|
+
constructor(client: Client, data: APIGuild);
|
|
104
|
+
iconURL(options?: {
|
|
105
|
+
size?: number;
|
|
106
|
+
}): string | null;
|
|
107
|
+
bannerURL(options?: {
|
|
108
|
+
size?: number;
|
|
109
|
+
}): string | null;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
declare class GuildMember extends Base {
|
|
113
|
+
readonly client: Client;
|
|
114
|
+
readonly id: string;
|
|
115
|
+
readonly user: User;
|
|
116
|
+
readonly guild: Guild;
|
|
117
|
+
nick: string | null;
|
|
118
|
+
readonly roles: string[];
|
|
119
|
+
readonly joinedAt: Date;
|
|
120
|
+
communicationDisabledUntil: Date | null;
|
|
121
|
+
constructor(client: Client, data: APIGuildMember & {
|
|
122
|
+
guild_id?: string;
|
|
123
|
+
}, guild: Guild);
|
|
124
|
+
get displayName(): string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
interface ClientOptions {
|
|
128
|
+
rest?: Partial<ConstructorParameters<typeof REST>[0]>;
|
|
129
|
+
intents?: number;
|
|
130
|
+
/** Optional WebSocket constructor (e.g. `require('ws')` in Node for compatibility) */
|
|
131
|
+
WebSocket?: new (url: string) => {
|
|
132
|
+
send(data: string | ArrayBufferLike): void;
|
|
133
|
+
close(code?: number): void;
|
|
134
|
+
readyState: number;
|
|
135
|
+
addEventListener?(type: string, listener: (e: unknown) => void): void;
|
|
136
|
+
on?(event: string, cb: (data?: unknown) => void): void;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
declare class ClientUser extends User {
|
|
141
|
+
readonly client: Client;
|
|
142
|
+
constructor(client: Client, data: APIUserPartial);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
declare const Events: {
|
|
146
|
+
readonly Ready: "ready";
|
|
147
|
+
readonly MessageCreate: "messageCreate";
|
|
148
|
+
readonly MessageUpdate: "messageUpdate";
|
|
149
|
+
readonly MessageDelete: "messageDelete";
|
|
150
|
+
readonly InteractionCreate: "interactionCreate";
|
|
151
|
+
readonly GuildCreate: "guildCreate";
|
|
152
|
+
readonly GuildUpdate: "guildUpdate";
|
|
153
|
+
readonly GuildDelete: "guildDelete";
|
|
154
|
+
readonly ChannelCreate: "channelCreate";
|
|
155
|
+
readonly ChannelUpdate: "channelUpdate";
|
|
156
|
+
readonly ChannelDelete: "channelDelete";
|
|
157
|
+
readonly GuildMemberAdd: "guildMemberAdd";
|
|
158
|
+
readonly GuildMemberUpdate: "guildMemberUpdate";
|
|
159
|
+
readonly GuildMemberRemove: "guildMemberRemove";
|
|
160
|
+
readonly VoiceStateUpdate: "voiceStateUpdate";
|
|
161
|
+
readonly VoiceServerUpdate: "voiceServerUpdate";
|
|
162
|
+
readonly VoiceStatesSync: "voiceStatesSync";
|
|
163
|
+
readonly Error: "error";
|
|
164
|
+
readonly Debug: "debug";
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
interface ClientEvents {
|
|
168
|
+
[Events.Ready]: [];
|
|
169
|
+
[Events.MessageCreate]: [message: Message];
|
|
170
|
+
[Events.MessageUpdate]: [oldMessage: Message | null, newMessage: Message];
|
|
171
|
+
[Events.MessageDelete]: [message: Message | {
|
|
172
|
+
id: string;
|
|
173
|
+
channelId: string;
|
|
174
|
+
}];
|
|
175
|
+
[Events.InteractionCreate]: [interaction: _fluxerjs_types.APIApplicationCommandInteraction];
|
|
176
|
+
[Events.GuildCreate]: [guild: Guild];
|
|
177
|
+
[Events.GuildUpdate]: [oldGuild: Guild, newGuild: Guild];
|
|
178
|
+
[Events.GuildDelete]: [guild: Guild];
|
|
179
|
+
[Events.ChannelCreate]: [channel: GuildChannel];
|
|
180
|
+
[Events.ChannelUpdate]: [oldChannel: Channel, newChannel: Channel];
|
|
181
|
+
[Events.ChannelDelete]: [channel: Channel];
|
|
182
|
+
[Events.GuildMemberAdd]: [member: GuildMember];
|
|
183
|
+
[Events.GuildMemberUpdate]: [oldMember: GuildMember, newMember: GuildMember];
|
|
184
|
+
[Events.GuildMemberRemove]: [member: GuildMember];
|
|
185
|
+
[Events.VoiceStateUpdate]: [data: GatewayVoiceStateUpdateDispatchData];
|
|
186
|
+
[Events.VoiceServerUpdate]: [data: GatewayVoiceServerUpdateDispatchData];
|
|
187
|
+
[Events.VoiceStatesSync]: [data: {
|
|
188
|
+
guildId: string;
|
|
189
|
+
voiceStates: Array<{
|
|
190
|
+
user_id: string;
|
|
191
|
+
channel_id: string | null;
|
|
192
|
+
}>;
|
|
193
|
+
}];
|
|
194
|
+
[Events.Error]: [error: Error];
|
|
195
|
+
[Events.Debug]: [message: string];
|
|
196
|
+
}
|
|
197
|
+
declare class Client extends EventEmitter {
|
|
198
|
+
readonly options: ClientOptions;
|
|
199
|
+
readonly rest: REST;
|
|
200
|
+
readonly guilds: Collection<string, Guild>;
|
|
201
|
+
readonly channels: Collection<string, Channel>;
|
|
202
|
+
readonly users: Collection<string, User>;
|
|
203
|
+
user: ClientUser | null;
|
|
204
|
+
readyAt: Date | null;
|
|
205
|
+
private _ws;
|
|
206
|
+
constructor(options?: ClientOptions);
|
|
207
|
+
get ws(): WebSocketManager;
|
|
208
|
+
/** Send a payload to the gateway (e.g. Voice State Update). Uses shard 0 when single-shard. */
|
|
209
|
+
sendToGateway(shardId: number, payload: GatewaySendPayload): void;
|
|
210
|
+
private handleDispatch;
|
|
211
|
+
login(token: string): Promise<string>;
|
|
212
|
+
destroy(): Promise<void>;
|
|
213
|
+
isReady(): this is Client & {
|
|
214
|
+
user: NonNullable<Client['user']>;
|
|
215
|
+
};
|
|
216
|
+
static get Routes(): typeof Routes;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
declare class FluxerError extends Error {
|
|
220
|
+
constructor(message: string);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
declare const ErrorCodes: {
|
|
224
|
+
readonly ClientNotReady: "CLIENT_NOT_READY";
|
|
225
|
+
readonly InvalidToken: "INVALID_TOKEN";
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
export { Base, CategoryChannel, Channel, Client, type ClientEvents, ClientUser, ErrorCodes, Events, FluxerError, Guild, GuildChannel, GuildMember, LinkChannel, Message, TextChannel, User, VoiceChannel };
|