lunibee 0.1.7 → 0.2.0

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 (78) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +225 -223
  3. package/dist/builders/commands.d.ts +6 -4
  4. package/dist/builders/components.d.ts +23 -0
  5. package/dist/builders/index.d.ts +2 -2
  6. package/dist/builders/index.js +120 -24
  7. package/dist/builders/index.js.map +9 -8
  8. package/dist/collection/index.d.ts +68 -1
  9. package/dist/collection/index.js +335 -1
  10. package/dist/collection/index.js.map +4 -4
  11. package/dist/core/collector.d.ts +13 -0
  12. package/dist/core/events.d.ts +112 -2
  13. package/dist/core/index.d.ts +30 -93
  14. package/dist/core/index.js +3386 -957
  15. package/dist/core/index.js.map +48 -24
  16. package/dist/core/permissions.d.ts +48 -0
  17. package/dist/formatters/index.js.map +1 -1
  18. package/dist/handlers/index.js.map +1 -1
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +3806 -1193
  21. package/dist/index.js.map +64 -43
  22. package/dist/managers/advanced.d.ts +116 -0
  23. package/dist/managers/base.d.ts +13 -2
  24. package/dist/managers/emoji.d.ts +1 -1
  25. package/dist/managers/guild-resources.d.ts +109 -0
  26. package/dist/managers/guild.d.ts +33 -2
  27. package/dist/managers/index.d.ts +44 -6
  28. package/dist/managers/index.js +1186 -150
  29. package/dist/managers/index.js.map +27 -21
  30. package/dist/managers/message.d.ts +10 -1
  31. package/dist/rest/decoder.d.ts +23 -0
  32. package/dist/rest/errors.d.ts +53 -0
  33. package/dist/rest/index.d.ts +21 -17
  34. package/dist/rest/index.js +526 -264
  35. package/dist/rest/index.js.map +14 -8
  36. package/dist/rest/limiter.d.ts +42 -0
  37. package/dist/rest/redis.d.ts +18 -1
  38. package/dist/rest/route.d.ts +31 -0
  39. package/dist/rest/routes.d.ts +22 -0
  40. package/dist/rest/scheduler.d.ts +42 -0
  41. package/dist/rest/store.d.ts +29 -0
  42. package/dist/rest/transport.d.ts +40 -0
  43. package/dist/sharding/bus.d.ts +31 -0
  44. package/dist/sharding/cluster.d.ts +10 -0
  45. package/dist/sharding/index.d.ts +39 -2
  46. package/dist/sharding/index.js +1105 -404
  47. package/dist/sharding/index.js.map +18 -8
  48. package/dist/structures/base.d.ts +10 -0
  49. package/dist/structures/channels.d.ts +56 -0
  50. package/dist/structures/index.d.ts +1 -0
  51. package/dist/structures/index.js +305 -311
  52. package/dist/structures/index.js.map +18 -14
  53. package/dist/structures/interactions.d.ts +38 -52
  54. package/dist/structures/options.d.ts +55 -0
  55. package/dist/structures/resources.d.ts +3 -3
  56. package/dist/types/gateway-events.d.ts +132 -0
  57. package/dist/types/gateway.d.ts +197 -0
  58. package/dist/types/index.d.ts +53 -260
  59. package/dist/types/index.js +44 -2
  60. package/dist/types/index.js.map +5 -4
  61. package/dist/utils/index.js.map +1 -1
  62. package/dist/voice/index.d.ts +32 -1
  63. package/dist/voice/index.js +73 -7
  64. package/dist/voice/index.js.map +3 -3
  65. package/dist/ws/close-codes.d.ts +23 -0
  66. package/dist/ws/decoder.d.ts +58 -0
  67. package/dist/ws/heartbeat.d.ts +87 -0
  68. package/dist/ws/index.d.ts +18 -65
  69. package/dist/ws/index.js +911 -385
  70. package/dist/ws/index.js.map +15 -5
  71. package/dist/ws/opcodes.d.ts +14 -0
  72. package/dist/ws/protocol.d.ts +110 -0
  73. package/dist/ws/reconnect.d.ts +108 -0
  74. package/dist/ws/send-budget.d.ts +17 -0
  75. package/dist/ws/session.d.ts +100 -0
  76. package/dist/ws/state.d.ts +27 -0
  77. package/dist/ws/transport.d.ts +80 -0
  78. package/package.json +21 -20
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Ekretos
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ekretos
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,223 +1,225 @@
1
- # Lunibee 🐝
2
-
3
- [![npm version](https://badge.fury.io/js/lunibee.svg)](https://www.npmjs.com/package/lunibee)
4
- [![NPM Downloads](https://img.shields.io/npm/dt/lunibee.svg?style=flat-square)](https://www.npmjs.com/package/lunibee)
5
- [![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?style=flat-square&logo=discord&logoColor=white)](https://discord.gg/SSADgyBpgw)
6
-
7
- [![NPM Graph](https://nodei.co/npm/lunibee.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/lunibee)
8
-
9
- A lightweight, Bun-first Discord API library for TypeScript.
10
-
11
- ## Requirements
12
-
13
- - [Bun](https://bun.sh/) for the supported runtime and package manager
14
- - TypeScript for typed application development
15
- - A Discord bot token for connecting to Discord
16
-
17
- ## Installation
18
-
19
- For repository development:
20
-
21
- ```bash
22
- bun install
23
- ```
24
-
25
- For application usage, install the published `lunibee` package when a release is available:
26
-
27
- ```bash
28
- bun add lunibee
29
- ```
30
-
31
- ## Documentation
32
-
33
- Full documentation, practical guides, and API references are available at **[lunibee.js.org](https://lunibee.js.org)**.
34
-
35
- ## Getting started
36
-
37
- ```ts
38
- import { Client, GatewayIntentBits } from "lunibee";
39
-
40
- const client = new Client({
41
- token: process.env.DISCORD_TOKEN!,
42
- intents: GatewayIntentBits.Guilds | GatewayIntentBits.GuildMessages
43
- });
44
-
45
- client.on("ready", user => {
46
- console.log(`Ready as ${user.username}`);
47
- });
48
-
49
- client.on("messageCreate", message => {
50
- console.log(message.content);
51
- });
52
-
53
- await client.login();
54
- ```
55
-
56
- Destroy the client when the application is shutting down:
57
-
58
- ```ts
59
- client.destroy();
60
- ```
61
-
62
- ## Client
63
-
64
- `Client` is the main application entry point. It coordinates the REST transport, resource managers, Gateway, event dispatch, interactions, and lifecycle state.
65
-
66
- ### Lifecycle
67
-
68
- ```text
69
- idle → connecting → ready
70
- ↑ ↓
71
- └──── reconnect ──┘
72
-
73
- ready → destroyed
74
- ```
75
-
76
- Useful APIs include:
77
-
78
- - `client.login()` — authenticate and connect to Discord.
79
- - `client.isReady()` — type guard for a ready client.
80
- - `client.destroy()` — close the Gateway and clear client-managed resources.
81
- - `client.rest` — access the REST transport.
82
- - `client.users`, `client.guilds`, `client.channels` — resource managers.
83
-
84
- ## Gateway
85
-
86
- The Gateway package implements the Discord WebSocket lifecycle:
87
-
88
- ```text
89
- CONNECT → HELLO → IDENTIFY/RESUME → READY → DISPATCH
90
- ↘ HEARTBEAT / ACK
91
- ↓
92
- RECONNECT
93
- ```
94
-
95
- The Gateway tracks sequence numbers and sessions, handles Discord resume URLs, heartbeat acknowledgement timeouts, invalid sessions, server reconnect requests, and stale/zombie connections.
96
-
97
- ```ts
98
- import { Gateway } from "@lunibee/ws";
99
-
100
- const gateway = new Gateway({
101
- token: process.env.DISCORD_TOKEN!,
102
- intents: 513
103
- });
104
-
105
- await gateway.connect();
106
- ```
107
-
108
- ## REST
109
-
110
- The REST client supports Discord bucket-aware rate limiting and retries. It consumes Discord's rate-limit headers including bucket identifiers, remaining requests, reset information, and `Retry-After`.
111
-
112
- Requests accept an `AbortSignal`:
113
-
114
- ```ts
115
- const controller = new AbortController();
116
-
117
- const request = client.rest.get("/users/@me", {
118
- signal: controller.signal
119
- });
120
-
121
- controller.abort();
122
- await request;
123
- ```
124
-
125
- `RESTError` includes HTTP status, Discord error code, method, path, and the raw error payload when available.
126
-
127
- ## Structures and caching
128
-
129
- Resource managers maintain canonical instances by Discord resource ID. Re-resolving an already cached resource returns the same structure instance, allowing identity-sensitive application code to remain consistent.
130
-
131
- REST-created and Gateway-updated resources are routed through manager cache mutation APIs so the same resource is not represented by unrelated structure instances.
132
-
133
- ## Permissions
134
-
135
- `PermissionSet` provides named and raw permission checks:
136
-
137
- ```ts
138
- if (member.permissions.has(Permission.manageMessages)) {
139
- // permitted
140
- }
141
- ```
142
-
143
- Multiple permissions can be checked together, and immutable `add()` / `remove()` operations return a new bitfield.
144
-
145
- ## Interactions
146
-
147
- Interactions expose an ergonomic acknowledgement lifecycle:
148
-
149
- ```ts
150
- if (interaction.isChatInputCommand()) {
151
- await interaction.deferReply();
152
- await interaction.editReply({ content: "Done!" });
153
- await interaction.followUp({ content: "Follow-up" });
154
- }
155
- ```
156
-
157
- Available lifecycle methods include `reply()`, `deferReply()`, `editReply()`, `deleteReply()`, and `followUp()`.
158
-
159
- ## Builders
160
-
161
- Lunibee provides strict builders for Discord payloads (Discord.js V2 compatible), including:
162
-
163
- - `ActionRowBuilder`
164
- - `ButtonBuilder`
165
- - `StringSelectBuilder`
166
- - `EmbedBuilder`
167
- - `ModalBuilder`
168
- - `TextInputBuilder`
169
-
170
- Builders validate Discord limits before serialization and expose typed `toJSON()` payloads.
171
-
172
- ## Sharding
173
-
174
- `@lunibee/sharding` manages multiple Gateway connections and supports explicit shard counts or Discord's recommended shard count.
175
-
176
- ```ts
177
- import { ShardManager } from "@lunibee/sharding";
178
-
179
- const shards = new ShardManager({
180
- token: process.env.DISCORD_TOKEN!,
181
- intents: 513,
182
- shardCount: "auto"
183
- });
184
-
185
- await shards.connect();
186
- ```
187
-
188
- Call `destroy()` during shutdown. The manager releases its Gateway instances and can initialize a fresh shard set on a later `connect()`.
189
-
190
- ## Package layout
191
-
192
- The monorepo is organized into focused packages:
193
-
194
- | Package | Responsibility |
195
- | --- | --- |
196
- | `@lunibee/types` | Discord API and shared TypeScript types |
197
- | `@lunibee/structures` | Discord resource and interaction structures |
198
- | `@lunibee/managers` | Resource caches and REST-backed managers |
199
- | `@lunibee/rest` | HTTP transport, routes, rate limits, retries |
200
- | `@lunibee/ws` | Discord Gateway connection |
201
- | `@lunibee/core` | Main client and high-level orchestration |
202
- | `@lunibee/builders` | Typed Discord payload builders |
203
- | `@lunibee/sharding` | Multi-Gateway shard management |
204
- | `lunibee` | End-user package entry point |
205
-
206
- ## Development
207
-
208
- Run the repository's checks before submitting changes:
209
-
210
- ```bash
211
- bun install
212
- bunx tsc --noEmit
213
- ```
214
-
215
- ## Documentation & API Reference
216
-
217
- The full, official API reference and practical guides are available at **[lunibee.js.org](https://lunibee.js.org)**.
218
-
219
- The source remains the authoritative API surface while Lunibee is pre-1.0. Public exports are intentionally split by responsibility so applications can import either the high-level `lunibee` package or individual packages when appropriate.
220
-
221
- ## Status
222
-
223
- Lunibee is in active development and the API may change before the first stable release.
1
+ # Lunibee 🐝
2
+
3
+ [![npm version](https://badge.fury.io/js/lunibee.svg)](https://www.npmjs.com/package/lunibee)
4
+ [![NPM Downloads](https://img.shields.io/npm/dt/lunibee.svg?style=flat-square)](https://www.npmjs.com/package/lunibee)
5
+ [![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?style=flat-square&logo=discord&logoColor=white)](https://discord.gg/SSADgyBpgw)
6
+
7
+ [![NPM Graph](https://nodei.co/npm/lunibee.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/lunibee)
8
+
9
+ A lightweight, Bun-first Discord API library for TypeScript.
10
+
11
+ ## Requirements
12
+
13
+ - [Bun](https://bun.sh/) for the supported runtime and package manager
14
+ - TypeScript for typed application development
15
+ - A Discord bot token for connecting to Discord
16
+
17
+ ## Installation
18
+
19
+ For repository development:
20
+
21
+ ```bash
22
+ bun install
23
+ ```
24
+
25
+ For application usage, install the published `lunibee` package when a release is available:
26
+
27
+ ```bash
28
+ bun add lunibee
29
+ ```
30
+
31
+ ## Documentation
32
+
33
+ Full documentation, practical guides, and API references are available at **[lunibee.js.org](https://lunibee.js.org)**.
34
+
35
+ ## Getting started
36
+
37
+ ```ts
38
+ import { Client, GatewayIntentBits } from "lunibee";
39
+
40
+ const client = new Client({
41
+ token: process.env.DISCORD_TOKEN!,
42
+ intents: GatewayIntentBits.Guilds | GatewayIntentBits.GuildMessages
43
+ });
44
+
45
+ client.on("ready", user => {
46
+ console.log(`Ready as ${user.username}`);
47
+ });
48
+
49
+ client.on("messageCreate", message => {
50
+ console.log(message.content);
51
+ });
52
+
53
+ await client.login();
54
+ ```
55
+
56
+ Destroy the client when the application is shutting down:
57
+
58
+ ```ts
59
+ client.destroy();
60
+ ```
61
+
62
+ ## Client
63
+
64
+ `Client` is the main application entry point. It coordinates the REST transport, resource managers, Gateway, event dispatch, interactions, and lifecycle state.
65
+
66
+ ### Lifecycle
67
+
68
+ ```text
69
+ idle → connecting → ready
70
+ ↑ ↓
71
+ └──── reconnect ──┘
72
+
73
+ ready → destroyed
74
+ ```
75
+
76
+ Useful APIs include:
77
+
78
+ - `client.login()` — authenticate and connect to Discord.
79
+ - `client.isReady()` — type guard for a ready client.
80
+ - `client.destroy()` — close the Gateway and clear client-managed resources.
81
+ - `client.rest` — access the REST transport.
82
+ - `client.users`, `client.guilds`, `client.channels` — resource managers.
83
+
84
+ ## Gateway
85
+
86
+ The Gateway package implements the Discord WebSocket lifecycle:
87
+
88
+ ```text
89
+ CONNECT → HELLO → IDENTIFY/RESUME → READY → DISPATCH
90
+ ↘ HEARTBEAT / ACK
91
+ ↓
92
+ RECONNECT
93
+ ```
94
+
95
+ The Gateway tracks sequence numbers and sessions, handles Discord resume URLs, heartbeat acknowledgement timeouts, invalid sessions, server reconnect requests, and stale/zombie connections.
96
+
97
+ ```ts
98
+ import { Gateway } from "@lunibee/ws";
99
+
100
+ const gateway = new Gateway({
101
+ token: process.env.DISCORD_TOKEN!,
102
+ intents: 513
103
+ });
104
+
105
+ await gateway.connect();
106
+ ```
107
+
108
+ ## REST
109
+
110
+ The REST client supports Discord bucket-aware rate limiting and retries. It consumes Discord's rate-limit headers including bucket identifiers, remaining requests, reset information, and `Retry-After`.
111
+
112
+ Requests accept an `AbortSignal`:
113
+
114
+ ```ts
115
+ const controller = new AbortController();
116
+
117
+ const request = client.rest.get("/users/@me", {
118
+ signal: controller.signal
119
+ });
120
+
121
+ controller.abort();
122
+ await request;
123
+ ```
124
+
125
+ `RESTError` includes HTTP status, Discord error code, method, path, and the raw error payload when available.
126
+
127
+ ## Structures and caching
128
+
129
+ Resource managers maintain canonical instances by Discord resource ID. Re-resolving an already cached resource returns the same structure instance, allowing identity-sensitive application code to remain consistent.
130
+
131
+ REST-created and Gateway-updated resources are routed through manager cache mutation APIs so the same resource is not represented by unrelated structure instances.
132
+
133
+ Discord resources are stored with `Collection.setWithoutTTL()` and leave the cache only through Gateway delete events or an explicit `delete()`, never through expiry. Messages are cached only with the `messageCache: { maxSize?, ttl? }` client option, and `cache: { users, members, roles, emojis }` turns off per-resource caching on large bots. For your own data, `new Collection(null, { ttl, maxSize, onEvict })` is a TTL/LRU cache. See the [0.2.0 upgrade guide](https://lunibee.js.org/getting-started/upgrading/).
134
+
135
+ ## Permissions
136
+
137
+ `PermissionSet` provides named and raw permission checks:
138
+
139
+ ```ts
140
+ if (member.permissions.has(Permission.manageMessages)) {
141
+ // permitted
142
+ }
143
+ ```
144
+
145
+ Multiple permissions can be checked together, and immutable `add()` / `remove()` operations return a new bitfield.
146
+
147
+ ## Interactions
148
+
149
+ Interactions expose an ergonomic acknowledgement lifecycle:
150
+
151
+ ```ts
152
+ if (interaction.isChatInputCommand()) {
153
+ await interaction.deferReply();
154
+ await interaction.editReply({ content: "Done!" });
155
+ await interaction.followUp({ content: "Follow-up" });
156
+ }
157
+ ```
158
+
159
+ Available lifecycle methods include `reply()`, `deferReply()`, `editReply()`, `deleteReply()`, and `followUp()`.
160
+
161
+ ## Builders
162
+
163
+ Lunibee provides strict builders for Discord payloads (Discord.js V2 compatible), including:
164
+
165
+ - `ActionRowBuilder`
166
+ - `ButtonBuilder`
167
+ - `StringSelectBuilder`
168
+ - `EmbedBuilder`
169
+ - `ModalBuilder`
170
+ - `TextInputBuilder`
171
+
172
+ Builders validate Discord limits before serialization and expose typed `toJSON()` payloads.
173
+
174
+ ## Sharding
175
+
176
+ `@lunibee/sharding` manages multiple Gateway connections and supports explicit shard counts or Discord's recommended shard count.
177
+
178
+ ```ts
179
+ import { ShardManager } from "@lunibee/sharding";
180
+
181
+ const shards = new ShardManager({
182
+ token: process.env.DISCORD_TOKEN!,
183
+ intents: 513,
184
+ shardCount: "auto"
185
+ });
186
+
187
+ await shards.connect();
188
+ ```
189
+
190
+ Call `destroy()` during shutdown. The manager releases its Gateway instances and can initialize a fresh shard set on a later `connect()`.
191
+
192
+ ## Package layout
193
+
194
+ The monorepo is organized into focused packages:
195
+
196
+ | Package | Responsibility |
197
+ | --- | --- |
198
+ | `@lunibee/types` | Discord API and shared TypeScript types |
199
+ | `@lunibee/structures` | Discord resource and interaction structures |
200
+ | `@lunibee/managers` | Resource caches and REST-backed managers |
201
+ | `@lunibee/rest` | HTTP transport, routes, rate limits, retries |
202
+ | `@lunibee/ws` | Discord Gateway connection |
203
+ | `@lunibee/core` | Main client and high-level orchestration |
204
+ | `@lunibee/builders` | Typed Discord payload builders |
205
+ | `@lunibee/sharding` | Multi-Gateway shard management |
206
+ | `lunibee` | End-user package entry point |
207
+
208
+ ## Development
209
+
210
+ Run the repository's checks before submitting changes:
211
+
212
+ ```bash
213
+ bun install
214
+ bunx tsc --noEmit
215
+ ```
216
+
217
+ ## Documentation & API Reference
218
+
219
+ The full, official API reference and practical guides are available at **[lunibee.js.org](https://lunibee.js.org)**.
220
+
221
+ The source remains the authoritative API surface while Lunibee is pre-1.0. Public exports are intentionally split by responsibility so applications can import either the high-level `lunibee` package or individual packages when appropriate.
222
+
223
+ ## Status
224
+
225
+ Lunibee is in active development and the API may change before the first stable release.
@@ -116,10 +116,13 @@ export declare class NumberOptionBuilder extends CommandOptionBuilder {
116
116
  /** Creates a subcommand group. */ constructor();
117
117
  /** Adds a subcommand to this group. */ addSubcommand(configure: (option: SubcommandBuilder) => SubcommandBuilder): this;
118
118
  }
119
- /** Base builder for application commands that appear in right-click context menus. */
120
- declare class ContextMenuCommandBuilder {
119
+ /** Builder for application commands that appear in right-click context menus.
120
+ * Discord.js-familiar: `new ContextMenuCommandBuilder().setName("x").setType(2)`. */
121
+ export declare class ContextMenuCommandBuilder {
121
122
  protected readonly data: Record<string, unknown>;
122
- constructor(type: 2 | 3);
123
+ constructor(type?: 2 | 3);
124
+ /** Sets the command type: 2 = USER, 3 = MESSAGE. @throws {RangeError} For any other type. */
125
+ setType(type: 2 | 3): this;
123
126
  /** Sets the command name (shown in the right-click menu).
124
127
  * Unlike CHAT_INPUT commands, USER (type 2) and MESSAGE (type 3) context-menu
125
128
  * command names may contain uppercase letters and spaces, so no lowercase/charset
@@ -152,4 +155,3 @@ export declare class UserCommandBuilder extends ContextMenuCommandBuilder {
152
155
  export declare class MessageCommandBuilder extends ContextMenuCommandBuilder {
153
156
  constructor();
154
157
  }
155
- export {};
@@ -35,6 +35,8 @@ export interface APIButtonComponent {
35
35
  label?: string;
36
36
  emoji?: APIComponentEmoji;
37
37
  url?: string;
38
+ /** SKU for premium (style 6) buttons. */
39
+ sku_id?: string;
38
40
  disabled?: boolean;
39
41
  }
40
42
  export interface APISelectOption {
@@ -164,10 +166,13 @@ export declare class StringSelectBuilder {
164
166
  }
165
167
  export declare class ButtonBuilder {
166
168
  #private;
169
+ /** Sets the style and drops fields that style cannot carry. */
167
170
  setStyle(style: APIButtonComponent["style"]): this;
168
171
  setCustomId(value: string): this;
169
172
  setLabel(value: string): this;
170
173
  setURL(value: string): this;
174
+ /** Makes this a premium (purchase) button for a SKU. Premium buttons carry no label, emoji, custom ID or URL. */
175
+ setSKUId(skuId: string): this;
171
176
  setEmoji(emoji: APIComponentEmoji | string): this;
172
177
  setDisabled(value?: boolean): this;
173
178
  toJSON(): APIButtonComponent;
@@ -264,3 +269,21 @@ export declare class ContentInventoryEntryBuilder {
264
269
  setId(id: string): this;
265
270
  toJSON(): APIContentInventoryEntryComponent;
266
271
  }
272
+ /** Discord.js-familiar alias for {@link StringSelectBuilder}. */
273
+ export { StringSelectBuilder as StringSelectMenuBuilder };
274
+ /** User select menu builder (Discord.js-familiar). */
275
+ export declare class UserSelectMenuBuilder extends EntitySelectBuilder {
276
+ constructor();
277
+ }
278
+ /** Role select menu builder (Discord.js-familiar). */
279
+ export declare class RoleSelectMenuBuilder extends EntitySelectBuilder {
280
+ constructor();
281
+ }
282
+ /** Mentionable select menu builder (Discord.js-familiar). */
283
+ export declare class MentionableSelectMenuBuilder extends EntitySelectBuilder {
284
+ constructor();
285
+ }
286
+ /** Channel select menu builder (Discord.js-familiar). */
287
+ export declare class ChannelSelectMenuBuilder extends EntitySelectBuilder {
288
+ constructor();
289
+ }
@@ -1,5 +1,5 @@
1
1
  export { EmbedBuilder } from "./embed.js";
2
2
  export type { EmbedField } from "./embed.js";
3
- export { ButtonBuilder, ButtonStyle, ComponentType, ActionRowBuilder, StringSelectBuilder, EntitySelectBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ContainerBuilder, SectionBuilder, TextDisplayBuilder, MediaGalleryBuilder, FileComponentBuilder, SeparatorBuilder, ThumbnailBuilder, ContentInventoryEntryBuilder, } from "./components.js";
4
- export { SlashCommandBuilder, StringOptionBuilder, IntegerOptionBuilder, NumberOptionBuilder, BooleanOptionBuilder, UserOptionBuilder, ChannelOptionBuilder, RoleOptionBuilder, MentionableOptionBuilder, AttachmentOptionBuilder, SubcommandBuilder, SubcommandGroupBuilder, ApplicationCommandOptionType, UserCommandBuilder, MessageCommandBuilder, } from "./commands.js";
3
+ export { ButtonBuilder, ButtonStyle, ComponentType, ActionRowBuilder, StringSelectBuilder, StringSelectMenuBuilder, EntitySelectBuilder, UserSelectMenuBuilder, RoleSelectMenuBuilder, MentionableSelectMenuBuilder, ChannelSelectMenuBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ContainerBuilder, SectionBuilder, TextDisplayBuilder, MediaGalleryBuilder, FileComponentBuilder, SeparatorBuilder, ThumbnailBuilder, ContentInventoryEntryBuilder, } from "./components.js";
4
+ export { SlashCommandBuilder, StringOptionBuilder, IntegerOptionBuilder, NumberOptionBuilder, BooleanOptionBuilder, UserOptionBuilder, ChannelOptionBuilder, RoleOptionBuilder, MentionableOptionBuilder, AttachmentOptionBuilder, SubcommandBuilder, SubcommandGroupBuilder, ApplicationCommandOptionType, UserCommandBuilder, MessageCommandBuilder, ContextMenuCommandBuilder, } from "./commands.js";
5
5
  export { AttachmentBuilder, type AttachmentData } from "./attachment.js";