@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/dist/index.js ADDED
@@ -0,0 +1,665 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __esm = (fn, res) => function __init() {
7
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
8
+ };
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+
23
+ // src/structures/Base.ts
24
+ var Base;
25
+ var init_Base = __esm({
26
+ "src/structures/Base.ts"() {
27
+ "use strict";
28
+ Base = class {
29
+ };
30
+ }
31
+ });
32
+
33
+ // src/util/Constants.ts
34
+ var CDN_URL;
35
+ var init_Constants = __esm({
36
+ "src/util/Constants.ts"() {
37
+ "use strict";
38
+ CDN_URL = "https://fluxerusercontent.com";
39
+ }
40
+ });
41
+
42
+ // src/structures/User.ts
43
+ var User;
44
+ var init_User = __esm({
45
+ "src/structures/User.ts"() {
46
+ "use strict";
47
+ init_Base();
48
+ init_Constants();
49
+ User = class extends Base {
50
+ client;
51
+ id;
52
+ username;
53
+ discriminator;
54
+ globalName;
55
+ avatar;
56
+ bot;
57
+ constructor(client, data) {
58
+ super();
59
+ this.client = client;
60
+ this.id = data.id;
61
+ this.username = data.username;
62
+ this.discriminator = data.discriminator;
63
+ this.globalName = data.global_name ?? null;
64
+ this.avatar = data.avatar ?? null;
65
+ this.bot = !!data.bot;
66
+ }
67
+ avatarURL(options) {
68
+ if (!this.avatar) return null;
69
+ const ext = options?.extension ?? "png";
70
+ const size = options?.size ? `?size=${options.size}` : "";
71
+ return `${CDN_URL}/avatars/${this.id}/${this.avatar}.${ext}${size}`;
72
+ }
73
+ displayAvatarURL(options) {
74
+ return this.avatarURL(options) ?? `${CDN_URL}/avatars/0/0.png`;
75
+ }
76
+ toString() {
77
+ return `<@${this.id}>`;
78
+ }
79
+ };
80
+ }
81
+ });
82
+
83
+ // src/structures/Message.ts
84
+ var Message_exports = {};
85
+ __export(Message_exports, {
86
+ Message: () => Message
87
+ });
88
+ var import_collection, import_types, Message;
89
+ var init_Message = __esm({
90
+ "src/structures/Message.ts"() {
91
+ "use strict";
92
+ init_Base();
93
+ import_collection = require("@fluxerjs/collection");
94
+ import_types = require("@fluxerjs/types");
95
+ init_User();
96
+ Message = class _Message extends Base {
97
+ client;
98
+ id;
99
+ channelId;
100
+ guildId;
101
+ author;
102
+ content;
103
+ createdAt;
104
+ editedAt;
105
+ pinned;
106
+ attachments;
107
+ channel;
108
+ constructor(client, data) {
109
+ super();
110
+ this.client = client;
111
+ this.id = data.id;
112
+ this.channelId = data.channel_id;
113
+ this.guildId = data.guild_id ?? null;
114
+ this.author = new User(client, data.author);
115
+ this.content = data.content;
116
+ this.createdAt = new Date(data.timestamp);
117
+ this.editedAt = data.edited_timestamp ? new Date(data.edited_timestamp) : null;
118
+ this.pinned = data.pinned;
119
+ this.attachments = new import_collection.Collection();
120
+ for (const a of data.attachments ?? []) this.attachments.set(a.id, a);
121
+ }
122
+ async reply(options) {
123
+ const body = typeof options === "string" ? { content: options, message_reference: { channel_id: this.channelId, message_id: this.id, guild_id: this.guildId ?? void 0 } } : { ...options, message_reference: { channel_id: this.channelId, message_id: this.id, guild_id: this.guildId ?? void 0 } };
124
+ const data = await this.client.rest.post(import_types.Routes.channelMessages(this.channelId), { body });
125
+ return new _Message(this.client, data);
126
+ }
127
+ async edit(options) {
128
+ const data = await this.client.rest.patch(import_types.Routes.channelMessage(this.channelId, this.id), { body: options });
129
+ return new _Message(this.client, data);
130
+ }
131
+ async delete() {
132
+ await this.client.rest.delete(import_types.Routes.channelMessage(this.channelId, this.id));
133
+ }
134
+ };
135
+ }
136
+ });
137
+
138
+ // src/structures/Guild.ts
139
+ var Guild_exports = {};
140
+ __export(Guild_exports, {
141
+ Guild: () => Guild
142
+ });
143
+ var import_collection2, Guild;
144
+ var init_Guild = __esm({
145
+ "src/structures/Guild.ts"() {
146
+ "use strict";
147
+ init_Base();
148
+ import_collection2 = require("@fluxerjs/collection");
149
+ init_Constants();
150
+ Guild = class extends Base {
151
+ client;
152
+ id;
153
+ name;
154
+ icon;
155
+ banner;
156
+ ownerId;
157
+ members = new import_collection2.Collection();
158
+ channels = new import_collection2.Collection();
159
+ constructor(client, data) {
160
+ super();
161
+ this.client = client;
162
+ this.id = data.id;
163
+ this.name = data.name;
164
+ this.icon = data.icon ?? null;
165
+ this.banner = data.banner ?? null;
166
+ this.ownerId = data.owner_id;
167
+ }
168
+ iconURL(options) {
169
+ if (!this.icon) return null;
170
+ const size = options?.size ? `?size=${options.size}` : "";
171
+ return `${CDN_URL}/icons/${this.id}/${this.icon}.png${size}`;
172
+ }
173
+ bannerURL(options) {
174
+ if (!this.banner) return null;
175
+ const size = options?.size ? `?size=${options.size}` : "";
176
+ return `${CDN_URL}/banners/${this.id}/${this.banner}.png${size}`;
177
+ }
178
+ };
179
+ }
180
+ });
181
+
182
+ // src/structures/Channel.ts
183
+ var Channel_exports = {};
184
+ __export(Channel_exports, {
185
+ CategoryChannel: () => CategoryChannel,
186
+ Channel: () => Channel,
187
+ GuildChannel: () => GuildChannel,
188
+ LinkChannel: () => LinkChannel,
189
+ TextChannel: () => TextChannel,
190
+ VoiceChannel: () => VoiceChannel
191
+ });
192
+ var import_types2, Channel, GuildChannel, TextChannel, CategoryChannel, VoiceChannel, LinkChannel;
193
+ var init_Channel = __esm({
194
+ "src/structures/Channel.ts"() {
195
+ "use strict";
196
+ init_Base();
197
+ import_types2 = require("@fluxerjs/types");
198
+ Channel = class extends Base {
199
+ client;
200
+ id;
201
+ type;
202
+ constructor(client, data) {
203
+ super();
204
+ this.client = client;
205
+ this.id = data.id;
206
+ this.type = data.type;
207
+ }
208
+ static from(client, data) {
209
+ const type = data.type ?? 0;
210
+ if (type === import_types2.ChannelType.GuildText) return new TextChannel(client, data);
211
+ if (type === import_types2.ChannelType.GuildCategory) return new CategoryChannel(client, data);
212
+ if (type === import_types2.ChannelType.GuildVoice) return new VoiceChannel(client, data);
213
+ if (type === import_types2.ChannelType.GuildLink) return new LinkChannel(client, data);
214
+ return new GuildChannel(client, data);
215
+ }
216
+ };
217
+ GuildChannel = class extends Channel {
218
+ guildId;
219
+ name;
220
+ position;
221
+ parentId;
222
+ constructor(client, data) {
223
+ super(client, data);
224
+ this.guildId = data.guild_id ?? "";
225
+ this.name = data.name ?? null;
226
+ this.position = data.position;
227
+ this.parentId = data.parent_id ?? null;
228
+ }
229
+ };
230
+ TextChannel = class extends GuildChannel {
231
+ topic;
232
+ nsfw;
233
+ rateLimitPerUser;
234
+ lastMessageId;
235
+ constructor(client, data) {
236
+ super(client, data);
237
+ this.topic = data.topic ?? null;
238
+ this.nsfw = data.nsfw ?? false;
239
+ this.rateLimitPerUser = data.rate_limit_per_user ?? 0;
240
+ this.lastMessageId = data.last_message_id ?? null;
241
+ }
242
+ async send(options) {
243
+ const body = typeof options === "string" ? { content: options } : options;
244
+ const { Message: Message2 } = await Promise.resolve().then(() => (init_Message(), Message_exports));
245
+ const data = await this.client.rest.post(import_types2.Routes.channelMessages(this.id), { body });
246
+ return new Message2(this.client, data);
247
+ }
248
+ };
249
+ CategoryChannel = class extends GuildChannel {
250
+ };
251
+ VoiceChannel = class extends GuildChannel {
252
+ bitrate;
253
+ userLimit;
254
+ rtcRegion;
255
+ constructor(client, data) {
256
+ super(client, data);
257
+ this.bitrate = data.bitrate ?? null;
258
+ this.userLimit = data.user_limit ?? null;
259
+ this.rtcRegion = data.rtc_region ?? null;
260
+ }
261
+ };
262
+ LinkChannel = class extends GuildChannel {
263
+ url;
264
+ constructor(client, data) {
265
+ super(client, data);
266
+ this.url = data.url ?? null;
267
+ }
268
+ };
269
+ }
270
+ });
271
+
272
+ // src/structures/GuildMember.ts
273
+ var GuildMember_exports = {};
274
+ __export(GuildMember_exports, {
275
+ GuildMember: () => GuildMember
276
+ });
277
+ var GuildMember;
278
+ var init_GuildMember = __esm({
279
+ "src/structures/GuildMember.ts"() {
280
+ "use strict";
281
+ init_Base();
282
+ init_User();
283
+ GuildMember = class extends Base {
284
+ client;
285
+ id;
286
+ user;
287
+ guild;
288
+ nick;
289
+ roles;
290
+ joinedAt;
291
+ communicationDisabledUntil;
292
+ constructor(client, data, guild) {
293
+ super();
294
+ this.client = client;
295
+ this.user = new User(client, data.user);
296
+ this.id = data.user.id;
297
+ this.guild = guild;
298
+ this.nick = data.nick ?? null;
299
+ this.roles = data.roles ?? [];
300
+ this.joinedAt = new Date(data.joined_at);
301
+ this.communicationDisabledUntil = data.communication_disabled_until ? new Date(data.communication_disabled_until) : null;
302
+ }
303
+ get displayName() {
304
+ return this.nick ?? this.user.globalName ?? this.user.username;
305
+ }
306
+ };
307
+ }
308
+ });
309
+
310
+ // src/client/ClientUser.ts
311
+ var ClientUser_exports = {};
312
+ __export(ClientUser_exports, {
313
+ ClientUser: () => ClientUser
314
+ });
315
+ var ClientUser;
316
+ var init_ClientUser = __esm({
317
+ "src/client/ClientUser.ts"() {
318
+ "use strict";
319
+ init_User();
320
+ ClientUser = class extends User {
321
+ constructor(client, data) {
322
+ super(client, { ...data });
323
+ }
324
+ };
325
+ }
326
+ });
327
+
328
+ // src/index.ts
329
+ var index_exports = {};
330
+ __export(index_exports, {
331
+ AttachmentBuilder: () => import_builders.AttachmentBuilder,
332
+ Base: () => Base,
333
+ CategoryChannel: () => CategoryChannel,
334
+ Channel: () => Channel,
335
+ Client: () => Client,
336
+ ClientUser: () => ClientUser,
337
+ EmbedBuilder: () => import_builders.EmbedBuilder,
338
+ ErrorCodes: () => ErrorCodes,
339
+ Events: () => Events,
340
+ FluxerError: () => FluxerError,
341
+ GatewayOpcodes: () => import_types4.GatewayOpcodes,
342
+ Guild: () => Guild,
343
+ GuildChannel: () => GuildChannel,
344
+ GuildMember: () => GuildMember,
345
+ LinkChannel: () => LinkChannel,
346
+ Message: () => Message,
347
+ MessagePayload: () => import_builders.MessagePayload,
348
+ Routes: () => import_types4.Routes,
349
+ TextChannel: () => TextChannel,
350
+ User: () => User,
351
+ VoiceChannel: () => VoiceChannel
352
+ });
353
+ module.exports = __toCommonJS(index_exports);
354
+
355
+ // src/client/Client.ts
356
+ var import_events = require("events");
357
+ var import_rest = require("@fluxerjs/rest");
358
+ var import_ws = require("@fluxerjs/ws");
359
+ var import_types3 = require("@fluxerjs/types");
360
+ var import_collection3 = require("@fluxerjs/collection");
361
+
362
+ // src/util/Events.ts
363
+ var Events = {
364
+ Ready: "ready",
365
+ MessageCreate: "messageCreate",
366
+ MessageUpdate: "messageUpdate",
367
+ MessageDelete: "messageDelete",
368
+ InteractionCreate: "interactionCreate",
369
+ GuildCreate: "guildCreate",
370
+ GuildUpdate: "guildUpdate",
371
+ GuildDelete: "guildDelete",
372
+ ChannelCreate: "channelCreate",
373
+ ChannelUpdate: "channelUpdate",
374
+ ChannelDelete: "channelDelete",
375
+ GuildMemberAdd: "guildMemberAdd",
376
+ GuildMemberUpdate: "guildMemberUpdate",
377
+ GuildMemberRemove: "guildMemberRemove",
378
+ VoiceStateUpdate: "voiceStateUpdate",
379
+ VoiceServerUpdate: "voiceServerUpdate",
380
+ VoiceStatesSync: "voiceStatesSync",
381
+ Error: "error",
382
+ Debug: "debug"
383
+ };
384
+
385
+ // src/client/Client.ts
386
+ var Client = class extends import_events.EventEmitter {
387
+ constructor(options = {}) {
388
+ super();
389
+ this.options = options;
390
+ this.rest = new import_rest.REST({
391
+ api: options.rest?.api ?? "https://api.fluxer.app",
392
+ version: options.rest?.version ?? "1",
393
+ ...options.rest
394
+ });
395
+ }
396
+ rest;
397
+ guilds = new import_collection3.Collection();
398
+ channels = new import_collection3.Collection();
399
+ users = new import_collection3.Collection();
400
+ user = null;
401
+ readyAt = null;
402
+ _ws = null;
403
+ get ws() {
404
+ if (!this._ws) throw new Error("Client is not logged in");
405
+ return this._ws;
406
+ }
407
+ /** Send a payload to the gateway (e.g. Voice State Update). Uses shard 0 when single-shard. */
408
+ sendToGateway(shardId, payload) {
409
+ this.ws.send(shardId, payload);
410
+ }
411
+ async handleDispatch(payload) {
412
+ if (payload.op !== 0 || !payload.t) return;
413
+ const { t: event, d } = payload;
414
+ try {
415
+ switch (event) {
416
+ case "MESSAGE_CREATE": {
417
+ const { Message: Message2 } = await Promise.resolve().then(() => (init_Message(), Message_exports));
418
+ this.emit(Events.MessageCreate, new Message2(this, d));
419
+ break;
420
+ }
421
+ case "MESSAGE_UPDATE": {
422
+ const { Message: Message2 } = await Promise.resolve().then(() => (init_Message(), Message_exports));
423
+ this.emit(Events.MessageUpdate, null, new Message2(this, d));
424
+ break;
425
+ }
426
+ case "MESSAGE_DELETE":
427
+ this.emit(Events.MessageDelete, { id: d.id, channelId: d.channel_id });
428
+ break;
429
+ case "GUILD_CREATE": {
430
+ const { Guild: Guild2 } = await Promise.resolve().then(() => (init_Guild(), Guild_exports));
431
+ const { Channel: Channel2 } = await Promise.resolve().then(() => (init_Channel(), Channel_exports));
432
+ const guild = new Guild2(this, d);
433
+ this.guilds.set(guild.id, guild);
434
+ const g = d;
435
+ for (const ch of g.channels ?? []) {
436
+ const channel = Channel2.from(this, ch);
437
+ if (channel) this.channels.set(channel.id, channel);
438
+ }
439
+ this.emit(Events.GuildCreate, guild);
440
+ if (g.voice_states?.length) {
441
+ this.emit(Events.VoiceStatesSync, { guildId: guild.id, voiceStates: g.voice_states });
442
+ }
443
+ break;
444
+ }
445
+ case "GUILD_UPDATE": {
446
+ const { Guild: Guild2 } = await Promise.resolve().then(() => (init_Guild(), Guild_exports));
447
+ const g = d;
448
+ const old = this.guilds.get(g.id);
449
+ const updated = new Guild2(this, g);
450
+ this.guilds.set(updated.id, updated);
451
+ this.emit(Events.GuildUpdate, old ?? updated, updated);
452
+ break;
453
+ }
454
+ case "GUILD_DELETE": {
455
+ const g = d;
456
+ const guild = this.guilds.get(g.id);
457
+ if (guild) {
458
+ this.guilds.delete(g.id);
459
+ this.emit(Events.GuildDelete, guild);
460
+ }
461
+ break;
462
+ }
463
+ case "CHANNEL_CREATE": {
464
+ const { Channel: Channel2 } = await Promise.resolve().then(() => (init_Channel(), Channel_exports));
465
+ const ch = Channel2.from(this, d);
466
+ if (ch) {
467
+ this.channels.set(ch.id, ch);
468
+ this.emit(Events.ChannelCreate, ch);
469
+ }
470
+ break;
471
+ }
472
+ case "CHANNEL_UPDATE": {
473
+ const { Channel: Channel2 } = await Promise.resolve().then(() => (init_Channel(), Channel_exports));
474
+ const ch = d;
475
+ const oldCh = this.channels.get(ch.id);
476
+ const newCh = Channel2.from(this, ch);
477
+ if (newCh) {
478
+ this.channels.set(newCh.id, newCh);
479
+ this.emit(Events.ChannelUpdate, oldCh ?? newCh, newCh);
480
+ }
481
+ break;
482
+ }
483
+ case "CHANNEL_DELETE": {
484
+ const ch = d;
485
+ const channel = this.channels.get(ch.id);
486
+ if (channel) {
487
+ this.channels.delete(ch.id);
488
+ this.emit(Events.ChannelDelete, channel);
489
+ }
490
+ break;
491
+ }
492
+ case "GUILD_MEMBER_ADD": {
493
+ const { GuildMember: GuildMember2 } = await Promise.resolve().then(() => (init_GuildMember(), GuildMember_exports));
494
+ const data = d;
495
+ const guild = this.guilds.get(data.guild_id);
496
+ if (guild) {
497
+ const member = new GuildMember2(this, data, guild);
498
+ guild.members.set(member.id, member);
499
+ this.emit(Events.GuildMemberAdd, member);
500
+ }
501
+ break;
502
+ }
503
+ case "GUILD_MEMBER_UPDATE": {
504
+ const { GuildMember: GuildMember2 } = await Promise.resolve().then(() => (init_GuildMember(), GuildMember_exports));
505
+ const data = d;
506
+ const guild = this.guilds.get(data.guild_id);
507
+ if (guild) {
508
+ const oldM = guild.members.get(data.user.id);
509
+ const newM = new GuildMember2(this, data, guild);
510
+ guild.members.set(newM.id, newM);
511
+ this.emit(Events.GuildMemberUpdate, oldM ?? newM, newM);
512
+ }
513
+ break;
514
+ }
515
+ case "GUILD_MEMBER_REMOVE": {
516
+ const data = d;
517
+ const guild = this.guilds.get(data.guild_id);
518
+ if (guild) {
519
+ const member = guild.members.get(data.user.id);
520
+ if (member) {
521
+ guild.members.delete(data.user.id);
522
+ this.emit(Events.GuildMemberRemove, member);
523
+ }
524
+ }
525
+ break;
526
+ }
527
+ case "INTERACTION_CREATE": {
528
+ this.emit(Events.InteractionCreate, d);
529
+ break;
530
+ }
531
+ case "VOICE_STATE_UPDATE": {
532
+ this.emit(Events.VoiceStateUpdate, d);
533
+ break;
534
+ }
535
+ case "VOICE_SERVER_UPDATE": {
536
+ this.emit(Events.VoiceServerUpdate, d);
537
+ break;
538
+ }
539
+ default:
540
+ break;
541
+ }
542
+ } catch (err) {
543
+ this.emit(Events.Error, err instanceof Error ? err : new Error(String(err)));
544
+ }
545
+ }
546
+ async login(token) {
547
+ this.rest.setToken(token);
548
+ let intents = this.options.intents ?? 0;
549
+ if (intents !== 0) {
550
+ if (typeof process !== "undefined" && process.emitWarning) {
551
+ process.emitWarning(
552
+ "Fluxer does not support intents yet. Value has been set to 0.",
553
+ { type: "FluxerIntents" }
554
+ );
555
+ } else {
556
+ console.warn("Fluxer does not support intents yet. Value has been set to 0.");
557
+ }
558
+ intents = 0;
559
+ }
560
+ this._ws = new import_ws.WebSocketManager({
561
+ token,
562
+ intents,
563
+ rest: { get: (route) => this.rest.get(route) },
564
+ version: this.options.rest?.version ?? "1",
565
+ WebSocket: this.options.WebSocket
566
+ });
567
+ this._ws.on("dispatch", ({ payload }) => {
568
+ this.handleDispatch(payload);
569
+ });
570
+ this._ws.on("ready", async ({ data }) => {
571
+ const { ClientUser: ClientUser2 } = await Promise.resolve().then(() => (init_ClientUser(), ClientUser_exports));
572
+ const { Guild: Guild2 } = await Promise.resolve().then(() => (init_Guild(), Guild_exports));
573
+ const { Channel: Channel2 } = await Promise.resolve().then(() => (init_Channel(), Channel_exports));
574
+ this.user = new ClientUser2(this, data.user);
575
+ for (const g of data.guilds ?? []) {
576
+ const guild = new Guild2(this, g);
577
+ this.guilds.set(guild.id, guild);
578
+ const withCh = g;
579
+ for (const ch of withCh.channels ?? []) {
580
+ const channel = Channel2.from(this, ch);
581
+ if (channel) this.channels.set(channel.id, channel);
582
+ }
583
+ if (withCh.voice_states?.length) {
584
+ this.emit(Events.VoiceStatesSync, { guildId: guild.id, voiceStates: withCh.voice_states });
585
+ }
586
+ }
587
+ this.readyAt = /* @__PURE__ */ new Date();
588
+ this.emit(Events.Ready);
589
+ });
590
+ this._ws.on("error", ({ error }) => this.emit(Events.Error, error));
591
+ this._ws.on("debug", (msg) => this.emit(Events.Debug, msg));
592
+ await this._ws.connect();
593
+ return token;
594
+ }
595
+ async destroy() {
596
+ if (this._ws) {
597
+ this._ws.destroy();
598
+ this._ws = null;
599
+ }
600
+ this.rest.setToken(null);
601
+ this.user = null;
602
+ this.readyAt = null;
603
+ this.guilds.clear();
604
+ this.channels.clear();
605
+ this.users.clear();
606
+ }
607
+ isReady() {
608
+ return this.readyAt !== null && this.user !== null;
609
+ }
610
+ static get Routes() {
611
+ return import_types3.Routes;
612
+ }
613
+ };
614
+
615
+ // src/index.ts
616
+ init_ClientUser();
617
+ init_Base();
618
+ init_User();
619
+ init_Guild();
620
+ init_Channel();
621
+ init_Message();
622
+ init_GuildMember();
623
+
624
+ // src/errors/FluxerError.ts
625
+ var FluxerError = class _FluxerError extends Error {
626
+ constructor(message) {
627
+ super(message);
628
+ this.name = "FluxerError";
629
+ Object.setPrototypeOf(this, _FluxerError.prototype);
630
+ }
631
+ };
632
+
633
+ // src/errors/ErrorCodes.ts
634
+ var ErrorCodes = {
635
+ ClientNotReady: "CLIENT_NOT_READY",
636
+ InvalidToken: "INVALID_TOKEN"
637
+ };
638
+
639
+ // src/index.ts
640
+ var import_builders = require("@fluxerjs/builders");
641
+ var import_types4 = require("@fluxerjs/types");
642
+ // Annotate the CommonJS export names for ESM import in node:
643
+ 0 && (module.exports = {
644
+ AttachmentBuilder,
645
+ Base,
646
+ CategoryChannel,
647
+ Channel,
648
+ Client,
649
+ ClientUser,
650
+ EmbedBuilder,
651
+ ErrorCodes,
652
+ Events,
653
+ FluxerError,
654
+ GatewayOpcodes,
655
+ Guild,
656
+ GuildChannel,
657
+ GuildMember,
658
+ LinkChannel,
659
+ Message,
660
+ MessagePayload,
661
+ Routes,
662
+ TextChannel,
663
+ User,
664
+ VoiceChannel
665
+ });