@fluxerjs/core 1.0.7 → 1.0.8

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.
Files changed (113) hide show
  1. package/dist/{Channel-OSOB6ELO.mjs → Channel-TWPDKW2P.mjs} +1 -1
  2. package/dist/{ClientUser-RNDKHQ3Z.mjs → ClientUser-2K2BACK7.mjs} +1 -2
  3. package/dist/{Guild-GOQZ7XP4.mjs → Guild-CMZGA6DW.mjs} +3 -1
  4. package/dist/{GuildMember-BJJNCL6W.mjs → GuildMember-DW2N6ITI.mjs} +1 -2
  5. package/dist/{Message-QXPHQOVC.mjs → Message-G2QIKZQK.mjs} +1 -2
  6. package/dist/MessageReaction-XRPYZDSC.mjs +7 -0
  7. package/dist/{Webhook-AG6QFM2I.mjs → Role-SVLWIAMN.mjs} +3 -3
  8. package/dist/{Webhook-2RHBXH7R.mjs → Webhook-2MQESB7Z.mjs} +1 -1
  9. package/dist/{chunk-J3EIGOXQ.mjs → chunk-4GCZFOS5.mjs} +20 -6
  10. package/dist/{chunk-PO5JZQVN.mjs → chunk-CO5EL5LH.mjs} +71 -14
  11. package/dist/{chunk-WYSHH4LR.mjs → chunk-CZIO2D7F.mjs} +72 -6
  12. package/dist/chunk-HBF5QEDH.mjs +42 -0
  13. package/dist/{chunk-NISGA2YZ.mjs → chunk-JVEOQFUX.mjs} +1 -4
  14. package/dist/chunk-SQVCCSNN.mjs +41 -0
  15. package/dist/chunk-TJVZEILY.mjs +120 -0
  16. package/dist/{chunk-T2NSVWBH.mjs → chunk-ZGMM6IPQ.mjs} +3 -1
  17. package/dist/index.d.mts +374 -61
  18. package/dist/index.d.ts +374 -61
  19. package/dist/index.js +1001 -409
  20. package/dist/index.mjs +505 -192
  21. package/package.json +27 -8
  22. package/dist/Channel-2WNJ445K.mjs +0 -17
  23. package/dist/Channel-BEZOW4VC.mjs +0 -17
  24. package/dist/Channel-DPLLHL7Y.mjs +0 -19
  25. package/dist/Channel-HM2UY4DN.mjs +0 -17
  26. package/dist/Channel-IKL3SJXN.mjs +0 -17
  27. package/dist/Channel-KILNV5V3.mjs +0 -17
  28. package/dist/Channel-KOTARBSF.mjs +0 -17
  29. package/dist/Channel-ON7O3D3M.mjs +0 -17
  30. package/dist/Channel-TOAQGSRX.mjs +0 -17
  31. package/dist/Channel-VENHOL7S.mjs +0 -17
  32. package/dist/Channel-YVGPVOVB.mjs +0 -17
  33. package/dist/ClientUser-6HBAPU6H.mjs +0 -8
  34. package/dist/ClientUser-ALGC4FNY.mjs +0 -8
  35. package/dist/ClientUser-J6HQVSDJ.mjs +0 -9
  36. package/dist/ClientUser-LLL6WX35.mjs +0 -8
  37. package/dist/ClientUser-N7ZXYAQ3.mjs +0 -8
  38. package/dist/Guild-36EGAAEW.mjs +0 -8
  39. package/dist/Guild-5UBZNIGD.mjs +0 -9
  40. package/dist/Guild-CA3W6DOD.mjs +0 -8
  41. package/dist/Guild-GIXJJBFM.mjs +0 -9
  42. package/dist/Guild-NHNQ5TIA.mjs +0 -8
  43. package/dist/Guild-S436SLOP.mjs +0 -9
  44. package/dist/Guild-WAFXK2EX.mjs +0 -9
  45. package/dist/Guild-XPOMHZZG.mjs +0 -9
  46. package/dist/Guild-ZOFF5LFR.mjs +0 -8
  47. package/dist/GuildMember-FX2JAWES.mjs +0 -8
  48. package/dist/GuildMember-K5FLBNHV.mjs +0 -8
  49. package/dist/GuildMember-RGVPVUAG.mjs +0 -9
  50. package/dist/GuildMember-UBNHZBCO.mjs +0 -8
  51. package/dist/GuildMember-UU26WJGN.mjs +0 -8
  52. package/dist/GuildMember-XF7K2R45.mjs +0 -9
  53. package/dist/Message-23Z3RPCZ.mjs +0 -9
  54. package/dist/Message-33APPS76.mjs +0 -9
  55. package/dist/Message-6RSAGIRP.mjs +0 -8
  56. package/dist/Message-OXTQHFCF.mjs +0 -8
  57. package/dist/Message-PZUU7ZFR.mjs +0 -9
  58. package/dist/Message-R7GZYIQQ.mjs +0 -8
  59. package/dist/Message-W624MHJF.mjs +0 -8
  60. package/dist/Message-XB5WNMHL.mjs +0 -9
  61. package/dist/Message-ZCS7IGJX.mjs +0 -8
  62. package/dist/Webhook-NUQCJAWZ.mjs +0 -7
  63. package/dist/Webhook-TGAZZRQQ.mjs +0 -7
  64. package/dist/chunk-2FIZRRSO.mjs +0 -88
  65. package/dist/chunk-3CNUPFDI.mjs +0 -59
  66. package/dist/chunk-4DBGMFOQ.mjs +0 -14
  67. package/dist/chunk-5HQRX3KJ.mjs +0 -70
  68. package/dist/chunk-62S4AB2S.mjs +0 -54
  69. package/dist/chunk-6CEMF2LO.mjs +0 -14
  70. package/dist/chunk-6EBNOON4.mjs +0 -86
  71. package/dist/chunk-72OY7B3D.mjs +0 -72
  72. package/dist/chunk-7FYM4D2E.mjs +0 -50
  73. package/dist/chunk-7GZN6JXT.mjs +0 -50
  74. package/dist/chunk-7H3TKJUT.mjs +0 -53
  75. package/dist/chunk-7SIS5CUA.mjs +0 -14
  76. package/dist/chunk-BGJSL6JI.mjs +0 -14
  77. package/dist/chunk-BUEXP5SZ.mjs +0 -70
  78. package/dist/chunk-BYTAODAO.mjs +0 -70
  79. package/dist/chunk-CQ5ZVTLX.mjs +0 -71
  80. package/dist/chunk-DJBCSVZX.mjs +0 -102
  81. package/dist/chunk-DLROMCIJ.mjs +0 -50
  82. package/dist/chunk-DPZHAYCK.mjs +0 -71
  83. package/dist/chunk-E75ZVY3I.mjs +0 -14
  84. package/dist/chunk-EF32ILJL.mjs +0 -102
  85. package/dist/chunk-F2EEQP5O.mjs +0 -86
  86. package/dist/chunk-FK5X6HFL.mjs +0 -111
  87. package/dist/chunk-FNFID6QB.mjs +0 -45
  88. package/dist/chunk-G4L7WAJS.mjs +0 -64
  89. package/dist/chunk-GUNWHOQO.mjs +0 -42
  90. package/dist/chunk-IPHFDI2L.mjs +0 -68
  91. package/dist/chunk-JJHZBWZM.mjs +0 -118
  92. package/dist/chunk-L25ON7WB.mjs +0 -52
  93. package/dist/chunk-LBBIQOSH.mjs +0 -53
  94. package/dist/chunk-LVMFPATK.mjs +0 -54
  95. package/dist/chunk-NOLYW3V4.mjs +0 -140
  96. package/dist/chunk-OHIHIQAS.mjs +0 -102
  97. package/dist/chunk-P4IRDGB4.mjs +0 -43
  98. package/dist/chunk-PYYXC7US.mjs +0 -76
  99. package/dist/chunk-QDCFQF6J.mjs +0 -36
  100. package/dist/chunk-QDNFJVVE.mjs +0 -70
  101. package/dist/chunk-QXJNV5EJ.mjs +0 -110
  102. package/dist/chunk-RXHJYGSJ.mjs +0 -53
  103. package/dist/chunk-SW6KNICI.mjs +0 -52
  104. package/dist/chunk-TE5IC7IP.mjs +0 -36
  105. package/dist/chunk-TMDZALIN.mjs +0 -110
  106. package/dist/chunk-WFONGZGK.mjs +0 -42
  107. package/dist/chunk-WZVY7DA6.mjs +0 -44
  108. package/dist/chunk-XTDZQD4A.mjs +0 -110
  109. package/dist/chunk-XXCBJJZE.mjs +0 -88
  110. package/dist/chunk-YKP7JHV2.mjs +0 -102
  111. package/dist/chunk-YSKZR66G.mjs +0 -102
  112. package/dist/chunk-ZHRQQZ4X.mjs +0 -102
  113. package/dist/chunk-ZMIMAMO2.mjs +0 -14
@@ -1,42 +0,0 @@
1
- import {
2
- CDN_URL
3
- } from "./chunk-HQMYRYMY.mjs";
4
- import {
5
- Base
6
- } from "./chunk-XNS4O6QJ.mjs";
7
-
8
- // src/structures/Guild.ts
9
- import { Collection } from "@fluxer/collection";
10
- var Guild = class extends Base {
11
- client;
12
- id;
13
- name;
14
- icon;
15
- banner;
16
- ownerId;
17
- members = new Collection();
18
- channels = new Collection();
19
- constructor(client, data) {
20
- super();
21
- this.client = client;
22
- this.id = data.id;
23
- this.name = data.name;
24
- this.icon = data.icon ?? null;
25
- this.banner = data.banner ?? null;
26
- this.ownerId = data.owner_id;
27
- }
28
- iconURL(options) {
29
- if (!this.icon) return null;
30
- const size = options?.size ? `?size=${options.size}` : "";
31
- return `${CDN_URL}/icons/${this.id}/${this.icon}.png${size}`;
32
- }
33
- bannerURL(options) {
34
- if (!this.banner) return null;
35
- const size = options?.size ? `?size=${options.size}` : "";
36
- return `${CDN_URL}/banners/${this.id}/${this.banner}.png${size}`;
37
- }
38
- };
39
-
40
- export {
41
- Guild
42
- };
@@ -1,44 +0,0 @@
1
- import {
2
- Base
3
- } from "./chunk-XNS4O6QJ.mjs";
4
-
5
- // src/util/Constants.ts
6
- var CDN_URL = "https://fluxerusercontent.com";
7
-
8
- // src/structures/User.ts
9
- var User = class extends Base {
10
- client;
11
- id;
12
- username;
13
- discriminator;
14
- globalName;
15
- avatar;
16
- bot;
17
- constructor(client, data) {
18
- super();
19
- this.client = client;
20
- this.id = data.id;
21
- this.username = data.username;
22
- this.discriminator = data.discriminator;
23
- this.globalName = data.global_name ?? null;
24
- this.avatar = data.avatar ?? null;
25
- this.bot = !!data.bot;
26
- }
27
- avatarURL(options) {
28
- if (!this.avatar) return null;
29
- const ext = options?.extension ?? "png";
30
- const size = options?.size ? `?size=${options.size}` : "";
31
- return `${CDN_URL}/avatars/${this.id}/${this.avatar}.${ext}${size}`;
32
- }
33
- displayAvatarURL(options) {
34
- return this.avatarURL(options) ?? `${CDN_URL}/avatars/0/0.png`;
35
- }
36
- toString() {
37
- return `<@${this.id}>`;
38
- }
39
- };
40
-
41
- export {
42
- CDN_URL,
43
- User
44
- };
@@ -1,110 +0,0 @@
1
- import {
2
- User
3
- } from "./chunk-DLROMCIJ.mjs";
4
- import {
5
- Base
6
- } from "./chunk-XNS4O6QJ.mjs";
7
-
8
- // src/structures/Message.ts
9
- import { Collection } from "@fluxerjs/collection";
10
- import { Routes } from "@fluxerjs/types";
11
- import { EmbedBuilder } from "@fluxerjs/builders";
12
- var Message = class _Message extends Base {
13
- client;
14
- id;
15
- channelId;
16
- guildId;
17
- author;
18
- content;
19
- createdAt;
20
- editedAt;
21
- pinned;
22
- attachments;
23
- channel;
24
- constructor(client, data) {
25
- super();
26
- this.client = client;
27
- this.id = data.id;
28
- this.channelId = data.channel_id;
29
- this.guildId = data.guild_id ?? null;
30
- this.author = new User(client, data.author);
31
- this.content = data.content;
32
- this.createdAt = new Date(data.timestamp);
33
- this.editedAt = data.edited_timestamp ? new Date(data.edited_timestamp) : null;
34
- this.pinned = data.pinned;
35
- this.attachments = new Collection();
36
- for (const a of data.attachments ?? []) this.attachments.set(a.id, a);
37
- }
38
- /**
39
- * Reply to this message.
40
- * @param options - Text content or object with content and/or embeds
41
- */
42
- async reply(options) {
43
- 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 } };
44
- const data = await this.client.rest.post(Routes.channelMessages(this.channelId), { body });
45
- return new _Message(this.client, data);
46
- }
47
- /**
48
- * Edit this message. Only the author (or admins) can edit.
49
- * @param options - New content and/or embeds
50
- */
51
- async edit(options) {
52
- const body = {};
53
- if (options.content !== void 0) body.content = options.content;
54
- if (options.embeds?.length) {
55
- body.embeds = options.embeds.map((e) => e instanceof EmbedBuilder ? e.toJSON() : e);
56
- }
57
- const data = await this.client.rest.patch(Routes.channelMessage(this.channelId, this.id), { body });
58
- return new _Message(this.client, data);
59
- }
60
- /** Delete this message. */
61
- async delete() {
62
- await this.client.rest.delete(Routes.channelMessage(this.channelId, this.id));
63
- }
64
- /**
65
- * Format emoji for reaction API: unicode string or "name:id" for custom.
66
- * @param emoji - Unicode emoji (e.g. "👍") or custom { name, id } or "name:id" string
67
- */
68
- static formatEmoji(emoji) {
69
- if (typeof emoji === "string") return emoji;
70
- return `${emoji.name}:${emoji.id}`;
71
- }
72
- /**
73
- * Add a reaction to this message (as the bot).
74
- * @param emoji - Unicode emoji (e.g. `👍`) or custom emoji `{ name, id }`
75
- */
76
- async react(emoji) {
77
- const emojiStr = _Message.formatEmoji(emoji);
78
- const route = `${Routes.channelMessageReaction(this.channelId, this.id, emojiStr)}/@me`;
79
- await this.client.rest.put(route);
80
- }
81
- /**
82
- * Remove the bot's reaction, or a specific user's reaction if userId is provided.
83
- * @param emoji - Unicode emoji or custom `{ name, id }`
84
- * @param userId - If provided, removes that user's reaction (requires moderator permissions)
85
- */
86
- async removeReaction(emoji, userId) {
87
- const emojiStr = _Message.formatEmoji(emoji);
88
- const route = `${Routes.channelMessageReaction(this.channelId, this.id, emojiStr)}/${userId ?? "@me"}`;
89
- await this.client.rest.delete(route);
90
- }
91
- /**
92
- * Remove all reactions from this message.
93
- * Requires moderator permissions.
94
- */
95
- async removeAllReactions() {
96
- await this.client.rest.delete(Routes.channelMessageReactions(this.channelId, this.id));
97
- }
98
- /**
99
- * Remove all reactions of a specific emoji from this message.
100
- * @param emoji - Unicode emoji or custom `{ name, id }`. Requires moderator permissions.
101
- */
102
- async removeReactionEmoji(emoji) {
103
- const emojiStr = _Message.formatEmoji(emoji);
104
- await this.client.rest.delete(Routes.channelMessageReaction(this.channelId, this.id, emojiStr));
105
- }
106
- };
107
-
108
- export {
109
- Message
110
- };
@@ -1,88 +0,0 @@
1
- import {
2
- Base
3
- } from "./chunk-XNS4O6QJ.mjs";
4
-
5
- // src/structures/Channel.ts
6
- import { ChannelType, Routes } from "@fluxerjs/types";
7
- var Channel = class extends Base {
8
- client;
9
- id;
10
- type;
11
- constructor(client, data) {
12
- super();
13
- this.client = client;
14
- this.id = data.id;
15
- this.type = data.type;
16
- }
17
- /** Create the appropriate channel instance from API data. */
18
- static from(client, data) {
19
- const type = data.type ?? 0;
20
- if (type === ChannelType.GuildText) return new TextChannel(client, data);
21
- if (type === ChannelType.GuildCategory) return new CategoryChannel(client, data);
22
- if (type === ChannelType.GuildVoice) return new VoiceChannel(client, data);
23
- if (type === ChannelType.GuildLink) return new LinkChannel(client, data);
24
- return new GuildChannel(client, data);
25
- }
26
- };
27
- var GuildChannel = class extends Channel {
28
- guildId;
29
- name;
30
- position;
31
- parentId;
32
- constructor(client, data) {
33
- super(client, data);
34
- this.guildId = data.guild_id ?? "";
35
- this.name = data.name ?? null;
36
- this.position = data.position;
37
- this.parentId = data.parent_id ?? null;
38
- }
39
- };
40
- var TextChannel = class extends GuildChannel {
41
- topic;
42
- nsfw;
43
- rateLimitPerUser;
44
- lastMessageId;
45
- constructor(client, data) {
46
- super(client, data);
47
- this.topic = data.topic ?? null;
48
- this.nsfw = data.nsfw ?? false;
49
- this.rateLimitPerUser = data.rate_limit_per_user ?? 0;
50
- this.lastMessageId = data.last_message_id ?? null;
51
- }
52
- /** Send a message to this channel. */
53
- async send(options) {
54
- const body = typeof options === "string" ? { content: options } : options;
55
- const { Message } = await import("./Message-PZUU7ZFR.mjs");
56
- const data = await this.client.rest.post(Routes.channelMessages(this.id), { body });
57
- return new Message(this.client, data);
58
- }
59
- };
60
- var CategoryChannel = class extends GuildChannel {
61
- };
62
- var VoiceChannel = class extends GuildChannel {
63
- bitrate;
64
- userLimit;
65
- rtcRegion;
66
- constructor(client, data) {
67
- super(client, data);
68
- this.bitrate = data.bitrate ?? null;
69
- this.userLimit = data.user_limit ?? null;
70
- this.rtcRegion = data.rtc_region ?? null;
71
- }
72
- };
73
- var LinkChannel = class extends GuildChannel {
74
- url;
75
- constructor(client, data) {
76
- super(client, data);
77
- this.url = data.url ?? null;
78
- }
79
- };
80
-
81
- export {
82
- Channel,
83
- GuildChannel,
84
- TextChannel,
85
- CategoryChannel,
86
- VoiceChannel,
87
- LinkChannel
88
- };
@@ -1,102 +0,0 @@
1
- import {
2
- Base
3
- } from "./chunk-XNS4O6QJ.mjs";
4
-
5
- // src/structures/Channel.ts
6
- import { ChannelType, Routes } from "@fluxerjs/types";
7
- var Channel = class extends Base {
8
- client;
9
- id;
10
- type;
11
- constructor(client, data) {
12
- super();
13
- this.client = client;
14
- this.id = data.id;
15
- this.type = data.type;
16
- }
17
- static from(client, data) {
18
- const type = data.type ?? 0;
19
- if (type === ChannelType.GuildText) return new TextChannel(client, data);
20
- if (type === ChannelType.GuildCategory) return new CategoryChannel(client, data);
21
- if (type === ChannelType.GuildVoice) return new VoiceChannel(client, data);
22
- if (type === ChannelType.GuildLink) return new LinkChannel(client, data);
23
- return new GuildChannel(client, data);
24
- }
25
- };
26
- var GuildChannel = class extends Channel {
27
- guildId;
28
- name;
29
- position;
30
- parentId;
31
- constructor(client, data) {
32
- super(client, data);
33
- this.guildId = data.guild_id ?? "";
34
- this.name = data.name ?? null;
35
- this.position = data.position;
36
- this.parentId = data.parent_id ?? null;
37
- }
38
- /** Create a webhook in this channel. Returns the webhook with token (required for send()). */
39
- async createWebhook(options) {
40
- const { Webhook } = await import("./Webhook-2RHBXH7R.mjs");
41
- const data = await this.client.rest.post(Routes.channelWebhooks(this.id), {
42
- body: options,
43
- auth: true
44
- });
45
- return new Webhook(this.client, data);
46
- }
47
- /** Fetch all webhooks in this channel. Returned webhooks do not include the token (cannot send). */
48
- async fetchWebhooks() {
49
- const { Webhook } = await import("./Webhook-2RHBXH7R.mjs");
50
- const data = await this.client.rest.get(Routes.channelWebhooks(this.id));
51
- const list = Array.isArray(data) ? data : Object.values(data ?? {});
52
- return list.map((w) => new Webhook(this.client, w));
53
- }
54
- };
55
- var TextChannel = class extends GuildChannel {
56
- topic;
57
- nsfw;
58
- rateLimitPerUser;
59
- lastMessageId;
60
- constructor(client, data) {
61
- super(client, data);
62
- this.topic = data.topic ?? null;
63
- this.nsfw = data.nsfw ?? false;
64
- this.rateLimitPerUser = data.rate_limit_per_user ?? 0;
65
- this.lastMessageId = data.last_message_id ?? null;
66
- }
67
- async send(options) {
68
- const body = typeof options === "string" ? { content: options } : options;
69
- const { Message } = await import("./Message-6RSAGIRP.mjs");
70
- const data = await this.client.rest.post(Routes.channelMessages(this.id), { body });
71
- return new Message(this.client, data);
72
- }
73
- };
74
- var CategoryChannel = class extends GuildChannel {
75
- };
76
- var VoiceChannel = class extends GuildChannel {
77
- bitrate;
78
- userLimit;
79
- rtcRegion;
80
- constructor(client, data) {
81
- super(client, data);
82
- this.bitrate = data.bitrate ?? null;
83
- this.userLimit = data.user_limit ?? null;
84
- this.rtcRegion = data.rtc_region ?? null;
85
- }
86
- };
87
- var LinkChannel = class extends GuildChannel {
88
- url;
89
- constructor(client, data) {
90
- super(client, data);
91
- this.url = data.url ?? null;
92
- }
93
- };
94
-
95
- export {
96
- Channel,
97
- GuildChannel,
98
- TextChannel,
99
- CategoryChannel,
100
- VoiceChannel,
101
- LinkChannel
102
- };
@@ -1,102 +0,0 @@
1
- import {
2
- Base
3
- } from "./chunk-XNS4O6QJ.mjs";
4
-
5
- // src/structures/Channel.ts
6
- import { ChannelType, Routes } from "@fluxerjs/types";
7
- var Channel = class extends Base {
8
- client;
9
- id;
10
- type;
11
- constructor(client, data) {
12
- super();
13
- this.client = client;
14
- this.id = data.id;
15
- this.type = data.type;
16
- }
17
- static from(client, data) {
18
- const type = data.type ?? 0;
19
- if (type === ChannelType.GuildText) return new TextChannel(client, data);
20
- if (type === ChannelType.GuildCategory) return new CategoryChannel(client, data);
21
- if (type === ChannelType.GuildVoice) return new VoiceChannel(client, data);
22
- if (type === ChannelType.GuildLink) return new LinkChannel(client, data);
23
- return new GuildChannel(client, data);
24
- }
25
- };
26
- var GuildChannel = class extends Channel {
27
- guildId;
28
- name;
29
- position;
30
- parentId;
31
- constructor(client, data) {
32
- super(client, data);
33
- this.guildId = data.guild_id ?? "";
34
- this.name = data.name ?? null;
35
- this.position = data.position;
36
- this.parentId = data.parent_id ?? null;
37
- }
38
- /** Create a webhook in this channel. Returns the webhook with token (required for send()). */
39
- async createWebhook(options) {
40
- const { Webhook } = await import("./Webhook-2RHBXH7R.mjs");
41
- const data = await this.client.rest.post(Routes.channelWebhooks(this.id), {
42
- body: options,
43
- auth: true
44
- });
45
- return new Webhook(this.client, data);
46
- }
47
- /** Fetch all webhooks in this channel. Returned webhooks do not include the token (cannot send). */
48
- async fetchWebhooks() {
49
- const { Webhook } = await import("./Webhook-2RHBXH7R.mjs");
50
- const data = await this.client.rest.get(Routes.channelWebhooks(this.id));
51
- const list = Array.isArray(data) ? data : Object.values(data ?? {});
52
- return list.map((w) => new Webhook(this.client, w));
53
- }
54
- };
55
- var TextChannel = class extends GuildChannel {
56
- topic;
57
- nsfw;
58
- rateLimitPerUser;
59
- lastMessageId;
60
- constructor(client, data) {
61
- super(client, data);
62
- this.topic = data.topic ?? null;
63
- this.nsfw = data.nsfw ?? false;
64
- this.rateLimitPerUser = data.rate_limit_per_user ?? 0;
65
- this.lastMessageId = data.last_message_id ?? null;
66
- }
67
- async send(options) {
68
- const body = typeof options === "string" ? { content: options } : options;
69
- const { Message } = await import("./Message-R7GZYIQQ.mjs");
70
- const data = await this.client.rest.post(Routes.channelMessages(this.id), { body });
71
- return new Message(this.client, data);
72
- }
73
- };
74
- var CategoryChannel = class extends GuildChannel {
75
- };
76
- var VoiceChannel = class extends GuildChannel {
77
- bitrate;
78
- userLimit;
79
- rtcRegion;
80
- constructor(client, data) {
81
- super(client, data);
82
- this.bitrate = data.bitrate ?? null;
83
- this.userLimit = data.user_limit ?? null;
84
- this.rtcRegion = data.rtc_region ?? null;
85
- }
86
- };
87
- var LinkChannel = class extends GuildChannel {
88
- url;
89
- constructor(client, data) {
90
- super(client, data);
91
- this.url = data.url ?? null;
92
- }
93
- };
94
-
95
- export {
96
- Channel,
97
- GuildChannel,
98
- TextChannel,
99
- CategoryChannel,
100
- VoiceChannel,
101
- LinkChannel
102
- };
@@ -1,102 +0,0 @@
1
- import {
2
- Base
3
- } from "./chunk-XNS4O6QJ.mjs";
4
-
5
- // src/structures/Channel.ts
6
- import { ChannelType, Routes } from "@fluxerjs/types";
7
- var Channel = class extends Base {
8
- client;
9
- id;
10
- type;
11
- constructor(client, data) {
12
- super();
13
- this.client = client;
14
- this.id = data.id;
15
- this.type = data.type;
16
- }
17
- static from(client, data) {
18
- const type = data.type ?? 0;
19
- if (type === ChannelType.GuildText) return new TextChannel(client, data);
20
- if (type === ChannelType.GuildCategory) return new CategoryChannel(client, data);
21
- if (type === ChannelType.GuildVoice) return new VoiceChannel(client, data);
22
- if (type === ChannelType.GuildLink) return new LinkChannel(client, data);
23
- return new GuildChannel(client, data);
24
- }
25
- };
26
- var GuildChannel = class extends Channel {
27
- guildId;
28
- name;
29
- position;
30
- parentId;
31
- constructor(client, data) {
32
- super(client, data);
33
- this.guildId = data.guild_id ?? "";
34
- this.name = data.name ?? null;
35
- this.position = data.position;
36
- this.parentId = data.parent_id ?? null;
37
- }
38
- /** Create a webhook in this channel. Returns the webhook with token (required for send()). */
39
- async createWebhook(options) {
40
- const { Webhook } = await import("./Webhook-2RHBXH7R.mjs");
41
- const data = await this.client.rest.post(Routes.channelWebhooks(this.id), {
42
- body: options,
43
- auth: true
44
- });
45
- return new Webhook(this.client, data);
46
- }
47
- /** Fetch all webhooks in this channel. Returned webhooks do not include the token (cannot send). */
48
- async fetchWebhooks() {
49
- const { Webhook } = await import("./Webhook-2RHBXH7R.mjs");
50
- const data = await this.client.rest.get(Routes.channelWebhooks(this.id));
51
- const list = Array.isArray(data) ? data : Object.values(data ?? {});
52
- return list.map((w) => new Webhook(this.client, w));
53
- }
54
- };
55
- var TextChannel = class extends GuildChannel {
56
- topic;
57
- nsfw;
58
- rateLimitPerUser;
59
- lastMessageId;
60
- constructor(client, data) {
61
- super(client, data);
62
- this.topic = data.topic ?? null;
63
- this.nsfw = data.nsfw ?? false;
64
- this.rateLimitPerUser = data.rate_limit_per_user ?? 0;
65
- this.lastMessageId = data.last_message_id ?? null;
66
- }
67
- async send(options) {
68
- const body = typeof options === "string" ? { content: options } : options;
69
- const { Message } = await import("./Message-23Z3RPCZ.mjs");
70
- const data = await this.client.rest.post(Routes.channelMessages(this.id), { body });
71
- return new Message(this.client, data);
72
- }
73
- };
74
- var CategoryChannel = class extends GuildChannel {
75
- };
76
- var VoiceChannel = class extends GuildChannel {
77
- bitrate;
78
- userLimit;
79
- rtcRegion;
80
- constructor(client, data) {
81
- super(client, data);
82
- this.bitrate = data.bitrate ?? null;
83
- this.userLimit = data.user_limit ?? null;
84
- this.rtcRegion = data.rtc_region ?? null;
85
- }
86
- };
87
- var LinkChannel = class extends GuildChannel {
88
- url;
89
- constructor(client, data) {
90
- super(client, data);
91
- this.url = data.url ?? null;
92
- }
93
- };
94
-
95
- export {
96
- Channel,
97
- GuildChannel,
98
- TextChannel,
99
- CategoryChannel,
100
- VoiceChannel,
101
- LinkChannel
102
- };
@@ -1,14 +0,0 @@
1
- import {
2
- User
3
- } from "./chunk-DLROMCIJ.mjs";
4
-
5
- // src/client/ClientUser.ts
6
- var ClientUser = class extends User {
7
- constructor(client, data) {
8
- super(client, { ...data });
9
- }
10
- };
11
-
12
- export {
13
- ClientUser
14
- };