@fluxerjs/core 1.0.4 → 1.0.6

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.d.ts CHANGED
@@ -1,11 +1,12 @@
1
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';
2
+ import { APIUserPartial, APIMessageAttachment, APIMessage, APIEmbed, APIWebhook, ChannelType, APIChannelPartial, APIChannel, APIGuild, APIGuildMember, GatewayPresenceUpdateData, GatewaySendPayload, Routes, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, GatewayVoiceStateUpdateDispatchData, GatewayVoiceServerUpdateDispatchData } from '@fluxerjs/types';
3
3
  export { GatewayOpcodes, Routes } from '@fluxerjs/types';
4
4
  import { Collection } from '@fluxerjs/collection';
5
+ import { EmbedBuilder } from '@fluxerjs/builders';
6
+ export { AttachmentBuilder, EmbedBuilder, MessagePayload } from '@fluxerjs/builders';
5
7
  import { EventEmitter } from 'events';
6
8
  import { REST } from '@fluxerjs/rest';
7
9
  import { WebSocketManager } from '@fluxerjs/ws';
8
- export { AttachmentBuilder, EmbedBuilder, MessagePayload } from '@fluxerjs/builders';
9
10
 
10
11
  declare abstract class Base {
11
12
  abstract readonly client: Client;
@@ -30,6 +31,11 @@ declare class User extends Base {
30
31
  toString(): string;
31
32
  }
32
33
 
34
+ /** Options for editing a message (content and/or embeds). */
35
+ interface MessageEditOptions {
36
+ content?: string;
37
+ embeds?: (APIEmbed | EmbedBuilder)[];
38
+ }
33
39
  declare class Message extends Base {
34
40
  readonly client: Client;
35
41
  readonly id: string;
@@ -47,10 +53,53 @@ declare class Message extends Base {
47
53
  content?: string;
48
54
  embeds?: APIEmbed[];
49
55
  }): Promise<Message>;
50
- edit(options: {
51
- content?: string;
52
- }): Promise<Message>;
56
+ edit(options: MessageEditOptions): Promise<Message>;
57
+ delete(): Promise<void>;
58
+ }
59
+
60
+ interface WebhookSendOptions {
61
+ content?: string;
62
+ embeds?: Array<Record<string, unknown>>;
63
+ username?: string;
64
+ avatar_url?: string;
65
+ tts?: boolean;
66
+ }
67
+ /**
68
+ * Represents a Discord/Fluxer webhook. Supports creating, fetching, sending, and deleting.
69
+ * The token is only available when the webhook was created; fetched webhooks cannot send messages.
70
+ */
71
+ declare class Webhook extends Base {
72
+ readonly client: Client;
73
+ readonly id: string;
74
+ readonly guildId: string;
75
+ readonly channelId: string;
76
+ name: string;
77
+ avatar: string | null;
78
+ /** Present only when webhook was created via createWebhook(); not returned when fetching. */
79
+ readonly token: string | null;
80
+ constructor(client: Client, data: APIWebhook & {
81
+ token?: string | null;
82
+ });
83
+ /** Delete this webhook. Requires bot token with Manage Webhooks permission. */
53
84
  delete(): Promise<void>;
85
+ /**
86
+ * Send a message via this webhook. Requires the webhook token (only present when created, not when fetched).
87
+ * @throws Error if token is not available
88
+ */
89
+ send(options: string | WebhookSendOptions): Promise<void>;
90
+ /**
91
+ * Fetch a webhook by ID using bot auth. The returned webhook will not have a token (cannot send).
92
+ */
93
+ static fetch(client: Client, webhookId: string): Promise<Webhook>;
94
+ /**
95
+ * Create a Webhook instance from an ID and token (e.g. from a stored webhook URL).
96
+ * Useful when you have the token from a previous createWebhook() call.
97
+ */
98
+ static fromToken(client: Client, webhookId: string, token: string, options?: {
99
+ channelId?: string;
100
+ guildId?: string;
101
+ name?: string;
102
+ }): Webhook;
54
103
  }
55
104
 
56
105
  declare abstract class Channel extends Base {
@@ -66,6 +115,13 @@ declare class GuildChannel extends Channel {
66
115
  position?: number;
67
116
  parentId: string | null;
68
117
  constructor(client: Client, data: APIChannel);
118
+ /** Create a webhook in this channel. Returns the webhook with token (required for send()). */
119
+ createWebhook(options: {
120
+ name: string;
121
+ avatar?: string | null;
122
+ }): Promise<Webhook>;
123
+ /** Fetch all webhooks in this channel. Returned webhooks do not include the token (cannot send). */
124
+ fetchWebhooks(): Promise<Webhook[]>;
69
125
  }
70
126
  declare class TextChannel extends GuildChannel {
71
127
  topic?: string | null;
@@ -107,6 +163,8 @@ declare class Guild extends Base {
107
163
  bannerURL(options?: {
108
164
  size?: number;
109
165
  }): string | null;
166
+ /** Fetch all webhooks in this guild. Returned webhooks do not include the token (cannot send). */
167
+ fetchWebhooks(): Promise<Webhook[]>;
110
168
  }
111
169
 
112
170
  declare class GuildMember extends Base {
@@ -127,6 +185,8 @@ declare class GuildMember extends Base {
127
185
  interface ClientOptions {
128
186
  rest?: Partial<ConstructorParameters<typeof REST>[0]>;
129
187
  intents?: number;
188
+ /** Initial presence (status, custom_status, etc.) sent on identify. Can also update via PresenceUpdate after connect. */
189
+ presence?: GatewayPresenceUpdateData;
130
190
  /** Optional WebSocket constructor (e.g. `require('ws')` in Node for compatibility) */
131
191
  WebSocket?: new (url: string) => {
132
192
  send(data: string | ArrayBufferLike): void;
@@ -147,6 +207,10 @@ declare const Events: {
147
207
  readonly MessageCreate: "messageCreate";
148
208
  readonly MessageUpdate: "messageUpdate";
149
209
  readonly MessageDelete: "messageDelete";
210
+ readonly MessageReactionAdd: "messageReactionAdd";
211
+ readonly MessageReactionRemove: "messageReactionRemove";
212
+ readonly MessageReactionRemoveAll: "messageReactionRemoveAll";
213
+ readonly MessageReactionRemoveEmoji: "messageReactionRemoveEmoji";
150
214
  readonly InteractionCreate: "interactionCreate";
151
215
  readonly GuildCreate: "guildCreate";
152
216
  readonly GuildUpdate: "guildUpdate";
@@ -172,6 +236,10 @@ interface ClientEvents {
172
236
  id: string;
173
237
  channelId: string;
174
238
  }];
239
+ [Events.MessageReactionAdd]: [data: GatewayMessageReactionAddDispatchData];
240
+ [Events.MessageReactionRemove]: [data: GatewayMessageReactionRemoveDispatchData];
241
+ [Events.MessageReactionRemoveAll]: [data: GatewayMessageReactionRemoveAllDispatchData];
242
+ [Events.MessageReactionRemoveEmoji]: [data: GatewayMessageReactionRemoveEmojiDispatchData];
175
243
  [Events.InteractionCreate]: [interaction: _fluxerjs_types.APIApplicationCommandInteraction];
176
244
  [Events.GuildCreate]: [guild: Guild];
177
245
  [Events.GuildUpdate]: [oldGuild: Guild, newGuild: Guild];
@@ -225,4 +293,4 @@ declare const ErrorCodes: {
225
293
  readonly InvalidToken: "INVALID_TOKEN";
226
294
  };
227
295
 
228
- export { Base, CategoryChannel, Channel, Client, type ClientEvents, ClientUser, ErrorCodes, Events, FluxerError, Guild, GuildChannel, GuildMember, LinkChannel, Message, TextChannel, User, VoiceChannel };
296
+ export { Base, CategoryChannel, Channel, Client, type ClientEvents, ClientUser, ErrorCodes, Events, FluxerError, Guild, GuildChannel, GuildMember, LinkChannel, Message, type MessageEditOptions, TextChannel, User, VoiceChannel, Webhook, type WebhookSendOptions };
package/dist/index.js CHANGED
@@ -85,13 +85,14 @@ var Message_exports = {};
85
85
  __export(Message_exports, {
86
86
  Message: () => Message
87
87
  });
88
- var import_collection, import_types, Message;
88
+ var import_collection, import_types, import_builders, Message;
89
89
  var init_Message = __esm({
90
90
  "src/structures/Message.ts"() {
91
91
  "use strict";
92
92
  init_Base();
93
93
  import_collection = require("@fluxerjs/collection");
94
94
  import_types = require("@fluxerjs/types");
95
+ import_builders = require("@fluxerjs/builders");
95
96
  init_User();
96
97
  Message = class _Message extends Base {
97
98
  client;
@@ -125,7 +126,12 @@ var init_Message = __esm({
125
126
  return new _Message(this.client, data);
126
127
  }
127
128
  async edit(options) {
128
- const data = await this.client.rest.patch(import_types.Routes.channelMessage(this.channelId, this.id), { body: options });
129
+ const body = {};
130
+ if (options.content !== void 0) body.content = options.content;
131
+ if (options.embeds?.length) {
132
+ body.embeds = options.embeds.map((e) => e instanceof import_builders.EmbedBuilder ? e.toJSON() : e);
133
+ }
134
+ const data = await this.client.rest.patch(import_types.Routes.channelMessage(this.channelId, this.id), { body });
129
135
  return new _Message(this.client, data);
130
136
  }
131
137
  async delete() {
@@ -135,18 +141,93 @@ var init_Message = __esm({
135
141
  }
136
142
  });
137
143
 
144
+ // src/structures/Webhook.ts
145
+ var Webhook_exports = {};
146
+ __export(Webhook_exports, {
147
+ Webhook: () => Webhook
148
+ });
149
+ var import_types2, Webhook;
150
+ var init_Webhook = __esm({
151
+ "src/structures/Webhook.ts"() {
152
+ "use strict";
153
+ init_Base();
154
+ import_types2 = require("@fluxerjs/types");
155
+ Webhook = class _Webhook extends Base {
156
+ client;
157
+ id;
158
+ guildId;
159
+ channelId;
160
+ name;
161
+ avatar;
162
+ /** Present only when webhook was created via createWebhook(); not returned when fetching. */
163
+ token;
164
+ constructor(client, data) {
165
+ super();
166
+ this.client = client;
167
+ this.id = data.id;
168
+ this.guildId = data.guild_id;
169
+ this.channelId = data.channel_id;
170
+ this.name = data.name ?? "Unknown";
171
+ this.avatar = data.avatar ?? null;
172
+ this.token = data.token ?? null;
173
+ }
174
+ /** Delete this webhook. Requires bot token with Manage Webhooks permission. */
175
+ async delete() {
176
+ await this.client.rest.delete(import_types2.Routes.webhook(this.id), { auth: true });
177
+ }
178
+ /**
179
+ * Send a message via this webhook. Requires the webhook token (only present when created, not when fetched).
180
+ * @throws Error if token is not available
181
+ */
182
+ async send(options) {
183
+ if (!this.token) {
184
+ throw new Error("Webhook token is required to send. The token is only returned when creating a webhook; fetched webhooks cannot send.");
185
+ }
186
+ const body = typeof options === "string" ? { content: options } : options;
187
+ await this.client.rest.post(import_types2.Routes.webhookExecute(this.id, this.token), {
188
+ body,
189
+ auth: false
190
+ });
191
+ }
192
+ /**
193
+ * Fetch a webhook by ID using bot auth. The returned webhook will not have a token (cannot send).
194
+ */
195
+ static async fetch(client, webhookId) {
196
+ const data = await client.rest.get(import_types2.Routes.webhook(webhookId));
197
+ return new _Webhook(client, data);
198
+ }
199
+ /**
200
+ * Create a Webhook instance from an ID and token (e.g. from a stored webhook URL).
201
+ * Useful when you have the token from a previous createWebhook() call.
202
+ */
203
+ static fromToken(client, webhookId, token, options) {
204
+ return new _Webhook(client, {
205
+ id: webhookId,
206
+ guild_id: options?.guildId ?? "",
207
+ channel_id: options?.channelId ?? "",
208
+ name: options?.name ?? "Webhook",
209
+ avatar: null,
210
+ token,
211
+ user: { id: "", username: "webhook", discriminator: "0" }
212
+ });
213
+ }
214
+ };
215
+ }
216
+ });
217
+
138
218
  // src/structures/Guild.ts
139
219
  var Guild_exports = {};
140
220
  __export(Guild_exports, {
141
221
  Guild: () => Guild
142
222
  });
143
- var import_collection2, Guild;
223
+ var import_collection2, import_types3, Guild;
144
224
  var init_Guild = __esm({
145
225
  "src/structures/Guild.ts"() {
146
226
  "use strict";
147
227
  init_Base();
148
228
  import_collection2 = require("@fluxerjs/collection");
149
229
  init_Constants();
230
+ import_types3 = require("@fluxerjs/types");
150
231
  Guild = class extends Base {
151
232
  client;
152
233
  id;
@@ -175,6 +256,13 @@ var init_Guild = __esm({
175
256
  const size = options?.size ? `?size=${options.size}` : "";
176
257
  return `${CDN_URL}/banners/${this.id}/${this.banner}.png${size}`;
177
258
  }
259
+ /** Fetch all webhooks in this guild. Returned webhooks do not include the token (cannot send). */
260
+ async fetchWebhooks() {
261
+ const { Webhook: Webhook2 } = await Promise.resolve().then(() => (init_Webhook(), Webhook_exports));
262
+ const data = await this.client.rest.get(import_types3.Routes.guildWebhooks(this.id));
263
+ const list = Array.isArray(data) ? data : Object.values(data ?? {});
264
+ return list.map((w) => new Webhook2(this.client, w));
265
+ }
178
266
  };
179
267
  }
180
268
  });
@@ -189,12 +277,12 @@ __export(Channel_exports, {
189
277
  TextChannel: () => TextChannel,
190
278
  VoiceChannel: () => VoiceChannel
191
279
  });
192
- var import_types2, Channel, GuildChannel, TextChannel, CategoryChannel, VoiceChannel, LinkChannel;
280
+ var import_types4, Channel, GuildChannel, TextChannel, CategoryChannel, VoiceChannel, LinkChannel;
193
281
  var init_Channel = __esm({
194
282
  "src/structures/Channel.ts"() {
195
283
  "use strict";
196
284
  init_Base();
197
- import_types2 = require("@fluxerjs/types");
285
+ import_types4 = require("@fluxerjs/types");
198
286
  Channel = class extends Base {
199
287
  client;
200
288
  id;
@@ -207,10 +295,10 @@ var init_Channel = __esm({
207
295
  }
208
296
  static from(client, data) {
209
297
  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);
298
+ if (type === import_types4.ChannelType.GuildText) return new TextChannel(client, data);
299
+ if (type === import_types4.ChannelType.GuildCategory) return new CategoryChannel(client, data);
300
+ if (type === import_types4.ChannelType.GuildVoice) return new VoiceChannel(client, data);
301
+ if (type === import_types4.ChannelType.GuildLink) return new LinkChannel(client, data);
214
302
  return new GuildChannel(client, data);
215
303
  }
216
304
  };
@@ -226,6 +314,22 @@ var init_Channel = __esm({
226
314
  this.position = data.position;
227
315
  this.parentId = data.parent_id ?? null;
228
316
  }
317
+ /** Create a webhook in this channel. Returns the webhook with token (required for send()). */
318
+ async createWebhook(options) {
319
+ const { Webhook: Webhook2 } = await Promise.resolve().then(() => (init_Webhook(), Webhook_exports));
320
+ const data = await this.client.rest.post(import_types4.Routes.channelWebhooks(this.id), {
321
+ body: options,
322
+ auth: true
323
+ });
324
+ return new Webhook2(this.client, data);
325
+ }
326
+ /** Fetch all webhooks in this channel. Returned webhooks do not include the token (cannot send). */
327
+ async fetchWebhooks() {
328
+ const { Webhook: Webhook2 } = await Promise.resolve().then(() => (init_Webhook(), Webhook_exports));
329
+ const data = await this.client.rest.get(import_types4.Routes.channelWebhooks(this.id));
330
+ const list = Array.isArray(data) ? data : Object.values(data ?? {});
331
+ return list.map((w) => new Webhook2(this.client, w));
332
+ }
229
333
  };
230
334
  TextChannel = class extends GuildChannel {
231
335
  topic;
@@ -242,7 +346,7 @@ var init_Channel = __esm({
242
346
  async send(options) {
243
347
  const body = typeof options === "string" ? { content: options } : options;
244
348
  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 });
349
+ const data = await this.client.rest.post(import_types4.Routes.channelMessages(this.id), { body });
246
350
  return new Message2(this.client, data);
247
351
  }
248
352
  };
@@ -328,27 +432,28 @@ var init_ClientUser = __esm({
328
432
  // src/index.ts
329
433
  var index_exports = {};
330
434
  __export(index_exports, {
331
- AttachmentBuilder: () => import_builders.AttachmentBuilder,
435
+ AttachmentBuilder: () => import_builders2.AttachmentBuilder,
332
436
  Base: () => Base,
333
437
  CategoryChannel: () => CategoryChannel,
334
438
  Channel: () => Channel,
335
439
  Client: () => Client,
336
440
  ClientUser: () => ClientUser,
337
- EmbedBuilder: () => import_builders.EmbedBuilder,
441
+ EmbedBuilder: () => import_builders2.EmbedBuilder,
338
442
  ErrorCodes: () => ErrorCodes,
339
443
  Events: () => Events,
340
444
  FluxerError: () => FluxerError,
341
- GatewayOpcodes: () => import_types4.GatewayOpcodes,
445
+ GatewayOpcodes: () => import_types6.GatewayOpcodes,
342
446
  Guild: () => Guild,
343
447
  GuildChannel: () => GuildChannel,
344
448
  GuildMember: () => GuildMember,
345
449
  LinkChannel: () => LinkChannel,
346
450
  Message: () => Message,
347
- MessagePayload: () => import_builders.MessagePayload,
348
- Routes: () => import_types4.Routes,
451
+ MessagePayload: () => import_builders2.MessagePayload,
452
+ Routes: () => import_types6.Routes,
349
453
  TextChannel: () => TextChannel,
350
454
  User: () => User,
351
- VoiceChannel: () => VoiceChannel
455
+ VoiceChannel: () => VoiceChannel,
456
+ Webhook: () => Webhook
352
457
  });
353
458
  module.exports = __toCommonJS(index_exports);
354
459
 
@@ -356,7 +461,7 @@ module.exports = __toCommonJS(index_exports);
356
461
  var import_events = require("events");
357
462
  var import_rest = require("@fluxerjs/rest");
358
463
  var import_ws = require("@fluxerjs/ws");
359
- var import_types3 = require("@fluxerjs/types");
464
+ var import_types5 = require("@fluxerjs/types");
360
465
  var import_collection3 = require("@fluxerjs/collection");
361
466
 
362
467
  // src/util/Events.ts
@@ -365,6 +470,10 @@ var Events = {
365
470
  MessageCreate: "messageCreate",
366
471
  MessageUpdate: "messageUpdate",
367
472
  MessageDelete: "messageDelete",
473
+ MessageReactionAdd: "messageReactionAdd",
474
+ MessageReactionRemove: "messageReactionRemove",
475
+ MessageReactionRemoveAll: "messageReactionRemoveAll",
476
+ MessageReactionRemoveEmoji: "messageReactionRemoveEmoji",
368
477
  InteractionCreate: "interactionCreate",
369
478
  GuildCreate: "guildCreate",
370
479
  GuildUpdate: "guildUpdate",
@@ -426,6 +535,18 @@ var Client = class extends import_events.EventEmitter {
426
535
  case "MESSAGE_DELETE":
427
536
  this.emit(Events.MessageDelete, { id: d.id, channelId: d.channel_id });
428
537
  break;
538
+ case "MESSAGE_REACTION_ADD":
539
+ this.emit(Events.MessageReactionAdd, d);
540
+ break;
541
+ case "MESSAGE_REACTION_REMOVE":
542
+ this.emit(Events.MessageReactionRemove, d);
543
+ break;
544
+ case "MESSAGE_REACTION_REMOVE_ALL":
545
+ this.emit(Events.MessageReactionRemoveAll, d);
546
+ break;
547
+ case "MESSAGE_REACTION_REMOVE_EMOJI":
548
+ this.emit(Events.MessageReactionRemoveEmoji, d);
549
+ break;
429
550
  case "GUILD_CREATE": {
430
551
  const { Guild: Guild2 } = await Promise.resolve().then(() => (init_Guild(), Guild_exports));
431
552
  const { Channel: Channel2 } = await Promise.resolve().then(() => (init_Channel(), Channel_exports));
@@ -560,6 +681,7 @@ var Client = class extends import_events.EventEmitter {
560
681
  this._ws = new import_ws.WebSocketManager({
561
682
  token,
562
683
  intents,
684
+ presence: this.options.presence,
563
685
  rest: { get: (route) => this.rest.get(route) },
564
686
  version: this.options.rest?.version ?? "1",
565
687
  WebSocket: this.options.WebSocket
@@ -608,7 +730,7 @@ var Client = class extends import_events.EventEmitter {
608
730
  return this.readyAt !== null && this.user !== null;
609
731
  }
610
732
  static get Routes() {
611
- return import_types3.Routes;
733
+ return import_types5.Routes;
612
734
  }
613
735
  };
614
736
 
@@ -619,6 +741,7 @@ init_User();
619
741
  init_Guild();
620
742
  init_Channel();
621
743
  init_Message();
744
+ init_Webhook();
622
745
  init_GuildMember();
623
746
 
624
747
  // src/errors/FluxerError.ts
@@ -637,8 +760,8 @@ var ErrorCodes = {
637
760
  };
638
761
 
639
762
  // src/index.ts
640
- var import_builders = require("@fluxerjs/builders");
641
- var import_types4 = require("@fluxerjs/types");
763
+ var import_builders2 = require("@fluxerjs/builders");
764
+ var import_types6 = require("@fluxerjs/types");
642
765
  // Annotate the CommonJS export names for ESM import in node:
643
766
  0 && (module.exports = {
644
767
  AttachmentBuilder,
@@ -661,5 +784,6 @@ var import_types4 = require("@fluxerjs/types");
661
784
  Routes,
662
785
  TextChannel,
663
786
  User,
664
- VoiceChannel
787
+ VoiceChannel,
788
+ Webhook
665
789
  });
package/dist/index.mjs CHANGED
@@ -1,9 +1,12 @@
1
1
  import {
2
2
  Message
3
- } from "./chunk-LBBIQOSH.mjs";
3
+ } from "./chunk-3CNUPFDI.mjs";
4
+ import {
5
+ Webhook
6
+ } from "./chunk-BUEXP5SZ.mjs";
4
7
  import {
5
8
  Guild
6
- } from "./chunk-GUNWHOQO.mjs";
9
+ } from "./chunk-7GZN6JXT.mjs";
7
10
  import {
8
11
  CategoryChannel,
9
12
  Channel,
@@ -11,7 +14,7 @@ import {
11
14
  LinkChannel,
12
15
  TextChannel,
13
16
  VoiceChannel
14
- } from "./chunk-F2EEQP5O.mjs";
17
+ } from "./chunk-OHIHIQAS.mjs";
15
18
  import {
16
19
  GuildMember
17
20
  } from "./chunk-TE5IC7IP.mjs";
@@ -39,6 +42,10 @@ var Events = {
39
42
  MessageCreate: "messageCreate",
40
43
  MessageUpdate: "messageUpdate",
41
44
  MessageDelete: "messageDelete",
45
+ MessageReactionAdd: "messageReactionAdd",
46
+ MessageReactionRemove: "messageReactionRemove",
47
+ MessageReactionRemoveAll: "messageReactionRemoveAll",
48
+ MessageReactionRemoveEmoji: "messageReactionRemoveEmoji",
42
49
  InteractionCreate: "interactionCreate",
43
50
  GuildCreate: "guildCreate",
44
51
  GuildUpdate: "guildUpdate",
@@ -88,21 +95,33 @@ var Client = class extends EventEmitter {
88
95
  try {
89
96
  switch (event) {
90
97
  case "MESSAGE_CREATE": {
91
- const { Message: Message2 } = await import("./Message-23Z3RPCZ.mjs");
98
+ const { Message: Message2 } = await import("./Message-33APPS76.mjs");
92
99
  this.emit(Events.MessageCreate, new Message2(this, d));
93
100
  break;
94
101
  }
95
102
  case "MESSAGE_UPDATE": {
96
- const { Message: Message2 } = await import("./Message-23Z3RPCZ.mjs");
103
+ const { Message: Message2 } = await import("./Message-33APPS76.mjs");
97
104
  this.emit(Events.MessageUpdate, null, new Message2(this, d));
98
105
  break;
99
106
  }
100
107
  case "MESSAGE_DELETE":
101
108
  this.emit(Events.MessageDelete, { id: d.id, channelId: d.channel_id });
102
109
  break;
110
+ case "MESSAGE_REACTION_ADD":
111
+ this.emit(Events.MessageReactionAdd, d);
112
+ break;
113
+ case "MESSAGE_REACTION_REMOVE":
114
+ this.emit(Events.MessageReactionRemove, d);
115
+ break;
116
+ case "MESSAGE_REACTION_REMOVE_ALL":
117
+ this.emit(Events.MessageReactionRemoveAll, d);
118
+ break;
119
+ case "MESSAGE_REACTION_REMOVE_EMOJI":
120
+ this.emit(Events.MessageReactionRemoveEmoji, d);
121
+ break;
103
122
  case "GUILD_CREATE": {
104
- const { Guild: Guild2 } = await import("./Guild-GOQZ7XP4.mjs");
105
- const { Channel: Channel2 } = await import("./Channel-TOAQGSRX.mjs");
123
+ const { Guild: Guild2 } = await import("./Guild-NHNQ5TIA.mjs");
124
+ const { Channel: Channel2 } = await import("./Channel-IKL3SJXN.mjs");
106
125
  const guild = new Guild2(this, d);
107
126
  this.guilds.set(guild.id, guild);
108
127
  const g = d;
@@ -117,7 +136,7 @@ var Client = class extends EventEmitter {
117
136
  break;
118
137
  }
119
138
  case "GUILD_UPDATE": {
120
- const { Guild: Guild2 } = await import("./Guild-GOQZ7XP4.mjs");
139
+ const { Guild: Guild2 } = await import("./Guild-NHNQ5TIA.mjs");
121
140
  const g = d;
122
141
  const old = this.guilds.get(g.id);
123
142
  const updated = new Guild2(this, g);
@@ -135,7 +154,7 @@ var Client = class extends EventEmitter {
135
154
  break;
136
155
  }
137
156
  case "CHANNEL_CREATE": {
138
- const { Channel: Channel2 } = await import("./Channel-TOAQGSRX.mjs");
157
+ const { Channel: Channel2 } = await import("./Channel-IKL3SJXN.mjs");
139
158
  const ch = Channel2.from(this, d);
140
159
  if (ch) {
141
160
  this.channels.set(ch.id, ch);
@@ -144,7 +163,7 @@ var Client = class extends EventEmitter {
144
163
  break;
145
164
  }
146
165
  case "CHANNEL_UPDATE": {
147
- const { Channel: Channel2 } = await import("./Channel-TOAQGSRX.mjs");
166
+ const { Channel: Channel2 } = await import("./Channel-IKL3SJXN.mjs");
148
167
  const ch = d;
149
168
  const oldCh = this.channels.get(ch.id);
150
169
  const newCh = Channel2.from(this, ch);
@@ -234,6 +253,7 @@ var Client = class extends EventEmitter {
234
253
  this._ws = new WebSocketManager({
235
254
  token,
236
255
  intents,
256
+ presence: this.options.presence,
237
257
  rest: { get: (route) => this.rest.get(route) },
238
258
  version: this.options.rest?.version ?? "1",
239
259
  WebSocket: this.options.WebSocket
@@ -243,8 +263,8 @@ var Client = class extends EventEmitter {
243
263
  });
244
264
  this._ws.on("ready", async ({ data }) => {
245
265
  const { ClientUser: ClientUser2 } = await import("./ClientUser-RNDKHQ3Z.mjs");
246
- const { Guild: Guild2 } = await import("./Guild-GOQZ7XP4.mjs");
247
- const { Channel: Channel2 } = await import("./Channel-TOAQGSRX.mjs");
266
+ const { Guild: Guild2 } = await import("./Guild-NHNQ5TIA.mjs");
267
+ const { Channel: Channel2 } = await import("./Channel-IKL3SJXN.mjs");
248
268
  this.user = new ClientUser2(this, data.user);
249
269
  for (const g of data.guilds ?? []) {
250
270
  const guild = new Guild2(this, g);
@@ -325,5 +345,6 @@ export {
325
345
  Routes2 as Routes,
326
346
  TextChannel,
327
347
  User,
328
- VoiceChannel
348
+ VoiceChannel,
349
+ Webhook
329
350
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.0.4",
6
+ "version": "1.0.6",
7
7
  "description": "A fully-featured SDK for Fluxer bots",
8
8
  "main": "./dist/index.js",
9
9
  "module": "./dist/index.mjs",
@@ -19,12 +19,12 @@
19
19
  "dist"
20
20
  ],
21
21
  "dependencies": {
22
- "@fluxerjs/rest": "1.0.4",
23
- "@fluxerjs/ws": "1.0.4",
24
- "@fluxerjs/builders": "1.0.4",
25
- "@fluxerjs/util": "1.0.4",
26
- "@fluxerjs/types": "1.0.4",
27
- "@fluxerjs/collection": "1.0.4"
22
+ "@fluxerjs/rest": "1.0.6",
23
+ "@fluxerjs/ws": "1.0.6",
24
+ "@fluxerjs/collection": "1.0.6",
25
+ "@fluxerjs/types": "1.0.6",
26
+ "@fluxerjs/builders": "1.0.6",
27
+ "@fluxerjs/util": "1.0.6"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "^20.0.0",