lunibee 0.2.3 → 0.3.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.
- package/README.md +3 -3
- package/dist/builders/attachment.d.ts +8 -4
- package/dist/builders/commands.d.ts +122 -149
- package/dist/builders/components.d.ts +10 -150
- package/dist/builders/embed.d.ts +66 -37
- package/dist/builders/index.d.ts +0 -4
- package/dist/builders/index.js +112 -221
- package/dist/builders/index.js.map +10 -9
- package/dist/collection/cache.d.ts +15 -6
- package/dist/collection/index.d.ts +92 -17
- package/dist/collection/index.js +471 -279
- package/dist/collection/index.js.map +4 -4
- package/dist/core/api.d.ts +130 -0
- package/dist/core/channel-create.d.ts +72 -0
- package/dist/core/commands.d.ts +232 -0
- package/dist/core/events.d.ts +24 -7
- package/dist/core/handles.d.ts +157 -0
- package/dist/core/index.d.ts +68 -4
- package/dist/core/index.js +2639 -493
- package/dist/core/index.js.map +47 -37
- package/dist/core/permissions.d.ts +7 -7
- package/dist/formatters/index.js +9 -5
- package/dist/formatters/index.js.map +3 -3
- package/dist/handlers/index.js +5 -10
- package/dist/handlers/index.js.map +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9527 -7809
- package/dist/index.js.map +63 -53
- package/dist/managers/advanced.d.ts +29 -1
- package/dist/managers/base.d.ts +22 -14
- package/dist/managers/emoji.d.ts +0 -2
- package/dist/managers/guild-resources.d.ts +13 -5
- package/dist/managers/guild.d.ts +40 -4
- package/dist/managers/index.d.ts +21 -13
- package/dist/managers/index.js +969 -386
- package/dist/managers/index.js.map +30 -25
- package/dist/managers/member.d.ts +9 -2
- package/dist/managers/message.d.ts +10 -15
- package/dist/managers/role.d.ts +18 -10
- package/dist/managers/thread.d.ts +68 -0
- package/dist/managers/user.d.ts +18 -0
- package/dist/rest/errors.d.ts +14 -7
- package/dist/rest/index.d.ts +24 -12
- package/dist/rest/index.js +70 -20
- package/dist/rest/index.js.map +9 -9
- package/dist/rest/redis.d.ts +1 -1
- package/dist/rest/route.d.ts +8 -4
- package/dist/rest/routes.d.ts +122 -48
- package/dist/rest/transport.d.ts +10 -5
- package/dist/rest/webhook.d.ts +9 -5
- package/dist/sharding/bus.d.ts +47 -19
- package/dist/sharding/cluster.d.ts +11 -0
- package/dist/sharding/gateway-bot.d.ts +18 -0
- package/dist/sharding/index.d.ts +64 -25
- package/dist/sharding/index.js +439 -124
- package/dist/sharding/index.js.map +19 -14
- package/dist/sharding/supervisor.d.ts +32 -0
- package/dist/sharding/transport.d.ts +45 -0
- package/dist/structures/audit-log.d.ts +99 -2
- package/dist/structures/base.d.ts +40 -23
- package/dist/structures/channels.d.ts +45 -14
- package/dist/structures/index.d.ts +8 -12
- package/dist/structures/index.js +280 -132
- package/dist/structures/index.js.map +21 -15
- package/dist/structures/interactions.d.ts +91 -63
- package/dist/structures/resources.d.ts +99 -52
- package/dist/structures/sticker.d.ts +33 -0
- package/dist/types/channel-kind.d.ts +26 -0
- package/dist/types/gateway.d.ts +24 -12
- package/dist/types/index.d.ts +115 -113
- package/dist/types/index.js +53 -48
- package/dist/types/index.js.map +6 -5
- package/dist/voice/index.d.ts +12 -4
- package/dist/voice/index.js +14 -18
- package/dist/voice/index.js.map +3 -3
- package/dist/ws/decoder.d.ts +6 -2
- package/dist/ws/dispatcher.d.ts +19 -0
- package/dist/ws/index.d.ts +61 -15
- package/dist/ws/index.js +194 -77
- package/dist/ws/index.js.map +13 -11
- package/dist/ws/protocol.d.ts +10 -2
- package/dist/ws/reconnect.d.ts +10 -0
- package/dist/ws/send-budget.d.ts +6 -2
- package/dist/ws/session.d.ts +14 -4
- package/dist/ws/state.d.ts +22 -11
- package/package.json +20 -16
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ import { Client, GatewayIntentBits } from "lunibee";
|
|
|
39
39
|
|
|
40
40
|
const client = new Client({
|
|
41
41
|
token: process.env.DISCORD_TOKEN!,
|
|
42
|
-
intents: GatewayIntentBits.Guilds
|
|
42
|
+
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages]
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
client.on("ready", user => {
|
|
@@ -99,7 +99,7 @@ import { Gateway } from "@lunibee/ws";
|
|
|
99
99
|
|
|
100
100
|
const gateway = new Gateway({
|
|
101
101
|
token: process.env.DISCORD_TOKEN!,
|
|
102
|
-
intents:
|
|
102
|
+
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages]
|
|
103
103
|
});
|
|
104
104
|
|
|
105
105
|
await gateway.connect();
|
|
@@ -180,7 +180,7 @@ import { ShardManager } from "@lunibee/sharding";
|
|
|
180
180
|
|
|
181
181
|
const shards = new ShardManager({
|
|
182
182
|
token: process.env.DISCORD_TOKEN!,
|
|
183
|
-
intents:
|
|
183
|
+
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages],
|
|
184
184
|
shardCount: "auto"
|
|
185
185
|
});
|
|
186
186
|
|
|
@@ -2,12 +2,20 @@ export interface AttachmentData {
|
|
|
2
2
|
name: string;
|
|
3
3
|
description?: string;
|
|
4
4
|
file: Uint8Array | ArrayBuffer | Blob | Buffer | string;
|
|
5
|
+
/**
|
|
6
|
+
* Folder a string `file` must stay inside (symlinks included). Set it
|
|
7
|
+
* whenever the path is not one you wrote yourself, e.g. from a command
|
|
8
|
+
* option: without it, any readable file on the machine can be uploaded.
|
|
9
|
+
*/
|
|
10
|
+
root?: string;
|
|
5
11
|
}
|
|
6
12
|
/** Builder for message attachments and file uploads. */
|
|
7
13
|
export declare class CreateAttachment {
|
|
8
14
|
name: string;
|
|
9
15
|
description?: string;
|
|
10
16
|
file: Uint8Array | ArrayBuffer | Blob | Buffer | string;
|
|
17
|
+
/** Folder a string `file` must stay inside; see {@link AttachmentData.root}. */
|
|
18
|
+
root?: string;
|
|
11
19
|
constructor(file: Uint8Array | ArrayBuffer | Blob | Buffer | string, data?: Partial<Omit<AttachmentData, "file">> | string);
|
|
12
20
|
/** Sets the attachment filename. */
|
|
13
21
|
setName(name: string): this;
|
|
@@ -18,7 +26,3 @@ export declare class CreateAttachment {
|
|
|
18
26
|
/** Resolves the attachment payload to a binary Uint8Array. */
|
|
19
27
|
toBuffer(): Promise<Uint8Array>;
|
|
20
28
|
}
|
|
21
|
-
/** @deprecated Use {@link CreateAttachment}. Removed in 0.3.0. */
|
|
22
|
-
export declare const AttachmentBuilder: typeof CreateAttachment;
|
|
23
|
-
/** @deprecated Use {@link CreateAttachment}. Removed in 0.3.0. */
|
|
24
|
-
export type AttachmentBuilder = CreateAttachment;
|
|
@@ -17,109 +17,164 @@ export type ApplicationCommandOptionEnum = (typeof ApplicationCommandOptionEnum)
|
|
|
17
17
|
/** Builds Discord application command payloads. */
|
|
18
18
|
export declare class CreateSlashCommand {
|
|
19
19
|
#private;
|
|
20
|
-
/** Sets the command name. */
|
|
21
|
-
|
|
20
|
+
/** Sets the command name. */
|
|
21
|
+
setName(name: string): this;
|
|
22
|
+
/** Sets the command description. */
|
|
23
|
+
setDescription(description: string): this;
|
|
22
24
|
/** Sets where the command can be used: 0 guilds, 1 the bot's DMs, 2 other DMs. @throws {RangeError} For any other value. */
|
|
23
25
|
setContexts(...contexts: number[]): this;
|
|
24
|
-
/** @deprecated Discord deprecated `dm_permission`. Use {@link CreateSlashCommand.setContexts}: `setContexts(0)` for guilds only, `setContexts(0, 1)` to allow the bot's DMs. Removed in 0.3.0. */
|
|
25
|
-
setDMPermission(enabled: boolean): this;
|
|
26
26
|
/** Sets whether the command is NSFW. */
|
|
27
27
|
setNSFW(nsfw?: boolean): this;
|
|
28
28
|
/** Sets whether the command is NSFW. */
|
|
29
29
|
setNsfw(nsfw?: boolean): this;
|
|
30
|
-
/** Sets command default member permissions. */
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
/** Adds a
|
|
35
|
-
|
|
36
|
-
/** Adds
|
|
37
|
-
|
|
38
|
-
/** Adds a
|
|
39
|
-
|
|
40
|
-
/** Adds
|
|
41
|
-
|
|
42
|
-
/** Adds a
|
|
43
|
-
|
|
44
|
-
/** Adds a
|
|
30
|
+
/** Sets command default member permissions. */
|
|
31
|
+
setDefaultMemberPermissions(permissions: bigint | number | string | null): this;
|
|
32
|
+
/** Sets command integration types. */
|
|
33
|
+
setIntegrationTypes(...types: number[]): this;
|
|
34
|
+
/** Adds a string option. */
|
|
35
|
+
addStringOption(configure: (option: CreateStringOption) => CreateStringOption): this;
|
|
36
|
+
/** Adds an integer option. */
|
|
37
|
+
addIntegerOption(configure: (option: CreateIntegerOption) => CreateIntegerOption): this;
|
|
38
|
+
/** Adds a number option. */
|
|
39
|
+
addNumberOption(configure: (option: CreateNumberOption) => CreateNumberOption): this;
|
|
40
|
+
/** Adds a boolean option. */
|
|
41
|
+
addBooleanOption(configure: (option: CreateBooleanOption) => CreateBooleanOption): this;
|
|
42
|
+
/** Adds a user option. */
|
|
43
|
+
addUserOption(configure: (option: CreateUserOption) => CreateUserOption): this;
|
|
44
|
+
/** Adds a channel option. */
|
|
45
|
+
addChannelOption(configure: (option: CreateChannelOption) => CreateChannelOption): this;
|
|
46
|
+
/** Adds a role option. */
|
|
47
|
+
addRoleOption(configure: (option: CreateRoleOption) => CreateRoleOption): this;
|
|
48
|
+
/** Adds a mentionable option. */
|
|
49
|
+
addMentionableOption(configure: (option: CreateMentionableOption) => CreateMentionableOption): this;
|
|
50
|
+
/** Adds an attachment option. */
|
|
51
|
+
addAttachmentOption(configure: (option: CreateAttachmentOption) => CreateAttachmentOption): this;
|
|
52
|
+
/** Adds a subcommand. */
|
|
53
|
+
addSubcommand(configure: (option: CreateSubcommand) => CreateSubcommand): this;
|
|
54
|
+
/** Adds a subcommand group. */
|
|
55
|
+
addSubcommandGroup(configure: (option: CreateSubcommandGroup) => CreateSubcommandGroup): this;
|
|
56
|
+
/** Serializes the command payload. */
|
|
57
|
+
toJSON(): Record<string, unknown>;
|
|
58
|
+
/** Adds a validated top-level command option. */
|
|
59
|
+
protected addOption(option: CreateCommandOption): this;
|
|
45
60
|
}
|
|
46
61
|
/** Base builder for command options. */
|
|
47
62
|
export declare class CreateCommandOption {
|
|
48
63
|
protected readonly data: Record<string, unknown>;
|
|
49
|
-
/** Creates an option builder. */
|
|
50
|
-
|
|
51
|
-
/** Sets the option
|
|
52
|
-
|
|
53
|
-
/** Sets
|
|
54
|
-
|
|
64
|
+
/** Creates an option builder. */
|
|
65
|
+
constructor(type: number);
|
|
66
|
+
/** Sets the option name. */
|
|
67
|
+
setName(name: string): this;
|
|
68
|
+
/** Sets the option description. */
|
|
69
|
+
setDescription(description: string): this;
|
|
70
|
+
/** Makes the option required or optional. */
|
|
71
|
+
setRequired(required?: boolean): this;
|
|
72
|
+
/** Sets autocomplete. */
|
|
73
|
+
setAutocomplete(enabled?: boolean): this;
|
|
74
|
+
/** Serializes the option payload. */
|
|
75
|
+
toJSON(): Record<string, unknown>;
|
|
55
76
|
}
|
|
56
77
|
/** Builds a string command option. */
|
|
57
78
|
export declare class CreateStringOption extends CreateCommandOption {
|
|
58
|
-
/** Creates a string option. */
|
|
59
|
-
|
|
79
|
+
/** Creates a string option. */
|
|
80
|
+
constructor();
|
|
81
|
+
/** Adds string choices. */
|
|
82
|
+
addChoices(...choices: Array<{
|
|
60
83
|
name: string;
|
|
61
84
|
value: string;
|
|
62
85
|
}>): this;
|
|
63
|
-
/** Sets the minimum string length. */
|
|
64
|
-
|
|
86
|
+
/** Sets the minimum string length. */
|
|
87
|
+
setMinLength(value: number): this;
|
|
88
|
+
/** Sets the maximum string length. */
|
|
89
|
+
setMaxLength(value: number): this;
|
|
65
90
|
}
|
|
66
|
-
/**
|
|
67
|
-
export declare class
|
|
68
|
-
|
|
91
|
+
/** Shared bounds, choices and autocomplete rules of integer and number options. */
|
|
92
|
+
export declare class CreateNumericOption extends CreateCommandOption {
|
|
93
|
+
#private;
|
|
94
|
+
/** Creates a numeric option; `integer` rejects fractional bounds. */
|
|
95
|
+
constructor(type: number, integer: boolean);
|
|
96
|
+
/** Sets the minimum value. */
|
|
69
97
|
setMinValue(value: number): this;
|
|
98
|
+
/** Sets the maximum value; it cannot be below the minimum. */
|
|
70
99
|
setMaxValue(value: number): this;
|
|
100
|
+
/** Enables autocomplete; options with choices cannot use it. */
|
|
71
101
|
setAutocomplete(enabled?: boolean): this;
|
|
102
|
+
/** Adds fixed choices. */
|
|
72
103
|
addChoices(...choices: {
|
|
73
104
|
name: string;
|
|
74
105
|
value: number;
|
|
75
106
|
}[]): this;
|
|
76
107
|
}
|
|
108
|
+
/** Builds an integer command option. */
|
|
109
|
+
export declare class CreateIntegerOption extends CreateNumericOption {
|
|
110
|
+
constructor();
|
|
111
|
+
}
|
|
77
112
|
/** Builds a number command option. */
|
|
78
|
-
export declare class CreateNumberOption extends
|
|
113
|
+
export declare class CreateNumberOption extends CreateNumericOption {
|
|
79
114
|
constructor();
|
|
80
|
-
setMinValue(value: number): this;
|
|
81
|
-
setMaxValue(value: number): this;
|
|
82
|
-
setAutocomplete(enabled?: boolean): this;
|
|
83
|
-
addChoices(...choices: {
|
|
84
|
-
name: string;
|
|
85
|
-
value: number;
|
|
86
|
-
}[]): this;
|
|
87
115
|
}
|
|
88
|
-
/** Builds a boolean command option. */
|
|
89
|
-
|
|
116
|
+
/** Builds a boolean command option. */
|
|
117
|
+
export declare class CreateBooleanOption extends CreateCommandOption {
|
|
118
|
+
/** Creates a boolean option. */
|
|
119
|
+
constructor();
|
|
90
120
|
}
|
|
91
|
-
/** Builds a user command option. */
|
|
92
|
-
|
|
121
|
+
/** Builds a user command option. */
|
|
122
|
+
export declare class CreateUserOption extends CreateCommandOption {
|
|
123
|
+
/** Creates a user option. */
|
|
124
|
+
constructor();
|
|
93
125
|
}
|
|
94
|
-
/** Builds a role command option. */
|
|
95
|
-
|
|
126
|
+
/** Builds a role command option. */
|
|
127
|
+
export declare class CreateRoleOption extends CreateCommandOption {
|
|
128
|
+
/** Creates a role option. */
|
|
129
|
+
constructor();
|
|
96
130
|
}
|
|
97
|
-
/** Builds a mentionable command option. */
|
|
98
|
-
|
|
131
|
+
/** Builds a mentionable command option. */
|
|
132
|
+
export declare class CreateMentionableOption extends CreateCommandOption {
|
|
133
|
+
/** Creates a mentionable option. */
|
|
134
|
+
constructor();
|
|
99
135
|
}
|
|
100
|
-
/** Builds an attachment command option. */
|
|
101
|
-
|
|
136
|
+
/** Builds an attachment command option. */
|
|
137
|
+
export declare class CreateAttachmentOption extends CreateCommandOption {
|
|
138
|
+
/** Creates an attachment option. */
|
|
139
|
+
constructor();
|
|
102
140
|
}
|
|
103
|
-
/** Builds a channel command option. */
|
|
104
|
-
|
|
105
|
-
/**
|
|
141
|
+
/** Builds a channel command option. */
|
|
142
|
+
export declare class CreateChannelOption extends CreateCommandOption {
|
|
143
|
+
/** Creates a channel option. */
|
|
144
|
+
constructor();
|
|
145
|
+
/** Restricts accepted channel types. */
|
|
146
|
+
addChannelTypes(...types: number[]): this;
|
|
106
147
|
}
|
|
107
|
-
/** Builds a nested subcommand. */
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
|
|
111
|
-
/** Adds a
|
|
112
|
-
|
|
113
|
-
/** Adds
|
|
114
|
-
|
|
115
|
-
/** Adds a
|
|
116
|
-
|
|
117
|
-
/** Adds
|
|
148
|
+
/** Builds a nested subcommand. */
|
|
149
|
+
export declare class CreateSubcommand extends CreateCommandOption {
|
|
150
|
+
/** Creates a subcommand. */
|
|
151
|
+
constructor();
|
|
152
|
+
/** Adds a string option to this subcommand. */
|
|
153
|
+
addStringOption(configure: (option: CreateStringOption) => CreateStringOption): this;
|
|
154
|
+
/** Adds an integer option to this subcommand. */
|
|
155
|
+
addIntegerOption(configure: (option: CreateIntegerOption) => CreateIntegerOption): this;
|
|
156
|
+
/** Adds a number option to this subcommand. */
|
|
157
|
+
addNumberOption(configure: (option: CreateNumberOption) => CreateNumberOption): this;
|
|
158
|
+
/** Adds a boolean option to this subcommand. */
|
|
159
|
+
addBooleanOption(configure: (option: CreateBooleanOption) => CreateBooleanOption): this;
|
|
160
|
+
/** Adds a user option to this subcommand. */
|
|
161
|
+
addUserOption(configure: (option: CreateUserOption) => CreateUserOption): this;
|
|
162
|
+
/** Adds a channel option to this subcommand. */
|
|
163
|
+
addChannelOption(configure: (option: CreateChannelOption) => CreateChannelOption): this;
|
|
164
|
+
/** Adds a role option to this subcommand. */
|
|
165
|
+
addRoleOption(configure: (option: CreateRoleOption) => CreateRoleOption): this;
|
|
166
|
+
/** Adds a mentionable option to this subcommand. */
|
|
167
|
+
addMentionableOption(configure: (option: CreateMentionableOption) => CreateMentionableOption): this;
|
|
168
|
+
/** Adds an attachment option to this subcommand. */
|
|
169
|
+
addAttachmentOption(configure: (option: CreateAttachmentOption) => CreateAttachmentOption): this;
|
|
118
170
|
protected addChildOption(option: CreateCommandOption): this;
|
|
119
171
|
}
|
|
120
|
-
/** Builds a nested subcommand group. */
|
|
121
|
-
|
|
122
|
-
/**
|
|
172
|
+
/** Builds a nested subcommand group. */
|
|
173
|
+
export declare class CreateSubcommandGroup extends CreateCommandOption {
|
|
174
|
+
/** Creates a subcommand group. */
|
|
175
|
+
constructor();
|
|
176
|
+
/** Adds a subcommand to this group. */
|
|
177
|
+
addSubcommand(configure: (option: CreateSubcommand) => CreateSubcommand): this;
|
|
123
178
|
}
|
|
124
179
|
/** Builder for application commands that appear in right-click context menus.
|
|
125
180
|
* Discord.js-familiar: `new CreateContextMenuCommand().setName("x").setType(2)`. */
|
|
@@ -139,8 +194,6 @@ export declare class CreateContextMenuCommand {
|
|
|
139
194
|
setName(name: string): this;
|
|
140
195
|
/** Sets default member permissions required to see this command. */
|
|
141
196
|
setDefaultMemberPermissions(permissions: bigint | number | string | null): this;
|
|
142
|
-
/** @deprecated Discord deprecated `dm_permission`. Use {@link CreateContextMenuCommand.setContexts}: `setContexts(0)` for guilds only, `setContexts(0, 1)` to allow the bot's DMs. Removed in 0.3.0. */
|
|
143
|
-
setDMPermission(enabled: boolean): this;
|
|
144
197
|
/** Sets command integration types (0 guild install, 1 user install). */
|
|
145
198
|
setIntegrationTypes(...types: number[]): this;
|
|
146
199
|
/** Sets where the command can be used: 0 guilds, 1 the bot's DMs, 2 other DMs. @throws {RangeError} For any other value. */
|
|
@@ -164,83 +217,3 @@ export declare class CreateUserCommand extends CreateContextMenuCommand {
|
|
|
164
217
|
export declare class CreateMessageCommand extends CreateContextMenuCommand {
|
|
165
218
|
constructor();
|
|
166
219
|
}
|
|
167
|
-
/** @deprecated Use {@link CreateAttachmentOption}. Removed in 0.3.0. */
|
|
168
|
-
export declare const AttachmentOptionBuilder: typeof CreateAttachmentOption;
|
|
169
|
-
/** @deprecated Use {@link CreateAttachmentOption}. Removed in 0.3.0. */
|
|
170
|
-
export type AttachmentOptionBuilder = CreateAttachmentOption;
|
|
171
|
-
/** @deprecated Use {@link CreateBooleanOption}. Removed in 0.3.0. */
|
|
172
|
-
export declare const BooleanOptionBuilder: typeof CreateBooleanOption;
|
|
173
|
-
/** @deprecated Use {@link CreateBooleanOption}. Removed in 0.3.0. */
|
|
174
|
-
export type BooleanOptionBuilder = CreateBooleanOption;
|
|
175
|
-
/** @deprecated Use {@link CreateChannelOption}. Removed in 0.3.0. */
|
|
176
|
-
export declare const ChannelOptionBuilder: typeof CreateChannelOption;
|
|
177
|
-
/** @deprecated Use {@link CreateChannelOption}. Removed in 0.3.0. */
|
|
178
|
-
export type ChannelOptionBuilder = CreateChannelOption;
|
|
179
|
-
/** @deprecated Use {@link CreateCommandOption}. Removed in 0.3.0. */
|
|
180
|
-
export declare const CommandOptionBuilder: typeof CreateCommandOption;
|
|
181
|
-
/** @deprecated Use {@link CreateCommandOption}. Removed in 0.3.0. */
|
|
182
|
-
export type CommandOptionBuilder = CreateCommandOption;
|
|
183
|
-
/** @deprecated Use {@link CreateContextMenuCommand}. Removed in 0.3.0. */
|
|
184
|
-
export declare const ContextMenuCommandBuilder: typeof CreateContextMenuCommand;
|
|
185
|
-
/** @deprecated Use {@link CreateContextMenuCommand}. Removed in 0.3.0. */
|
|
186
|
-
export type ContextMenuCommandBuilder = CreateContextMenuCommand;
|
|
187
|
-
/** @deprecated Use {@link CreateIntegerOption}. Removed in 0.3.0. */
|
|
188
|
-
export declare const IntegerOptionBuilder: typeof CreateIntegerOption;
|
|
189
|
-
/** @deprecated Use {@link CreateIntegerOption}. Removed in 0.3.0. */
|
|
190
|
-
export type IntegerOptionBuilder = CreateIntegerOption;
|
|
191
|
-
/** @deprecated Use {@link CreateMentionableOption}. Removed in 0.3.0. */
|
|
192
|
-
export declare const MentionableOptionBuilder: typeof CreateMentionableOption;
|
|
193
|
-
/** @deprecated Use {@link CreateMentionableOption}. Removed in 0.3.0. */
|
|
194
|
-
export type MentionableOptionBuilder = CreateMentionableOption;
|
|
195
|
-
/** @deprecated Use {@link CreateMessageCommand}. Removed in 0.3.0. */
|
|
196
|
-
export declare const MessageCommandBuilder: typeof CreateMessageCommand;
|
|
197
|
-
/** @deprecated Use {@link CreateMessageCommand}. Removed in 0.3.0. */
|
|
198
|
-
export type MessageCommandBuilder = CreateMessageCommand;
|
|
199
|
-
/** @deprecated Use {@link CreateNumberOption}. Removed in 0.3.0. */
|
|
200
|
-
export declare const NumberOptionBuilder: typeof CreateNumberOption;
|
|
201
|
-
/** @deprecated Use {@link CreateNumberOption}. Removed in 0.3.0. */
|
|
202
|
-
export type NumberOptionBuilder = CreateNumberOption;
|
|
203
|
-
/** @deprecated Use {@link CreateRoleOption}. Removed in 0.3.0. */
|
|
204
|
-
export declare const RoleOptionBuilder: typeof CreateRoleOption;
|
|
205
|
-
/** @deprecated Use {@link CreateRoleOption}. Removed in 0.3.0. */
|
|
206
|
-
export type RoleOptionBuilder = CreateRoleOption;
|
|
207
|
-
/** @deprecated Use {@link CreateSlashCommand}. Removed in 0.3.0. */
|
|
208
|
-
export declare const SlashCommandBuilder: typeof CreateSlashCommand;
|
|
209
|
-
/** @deprecated Use {@link CreateSlashCommand}. Removed in 0.3.0. */
|
|
210
|
-
export type SlashCommandBuilder = CreateSlashCommand;
|
|
211
|
-
/** @deprecated Use {@link CreateStringOption}. Removed in 0.3.0. */
|
|
212
|
-
export declare const StringOptionBuilder: typeof CreateStringOption;
|
|
213
|
-
/** @deprecated Use {@link CreateStringOption}. Removed in 0.3.0. */
|
|
214
|
-
export type StringOptionBuilder = CreateStringOption;
|
|
215
|
-
/** @deprecated Use {@link CreateSubcommand}. Removed in 0.3.0. */
|
|
216
|
-
export declare const SubcommandBuilder: typeof CreateSubcommand;
|
|
217
|
-
/** @deprecated Use {@link CreateSubcommand}. Removed in 0.3.0. */
|
|
218
|
-
export type SubcommandBuilder = CreateSubcommand;
|
|
219
|
-
/** @deprecated Use {@link CreateSubcommandGroup}. Removed in 0.3.0. */
|
|
220
|
-
export declare const SubcommandGroupBuilder: typeof CreateSubcommandGroup;
|
|
221
|
-
/** @deprecated Use {@link CreateSubcommandGroup}. Removed in 0.3.0. */
|
|
222
|
-
export type SubcommandGroupBuilder = CreateSubcommandGroup;
|
|
223
|
-
/** @deprecated Use {@link CreateUserCommand}. Removed in 0.3.0. */
|
|
224
|
-
export declare const UserCommandBuilder: typeof CreateUserCommand;
|
|
225
|
-
/** @deprecated Use {@link CreateUserCommand}. Removed in 0.3.0. */
|
|
226
|
-
export type UserCommandBuilder = CreateUserCommand;
|
|
227
|
-
/** @deprecated Use {@link CreateUserOption}. Removed in 0.3.0. */
|
|
228
|
-
export declare const UserOptionBuilder: typeof CreateUserOption;
|
|
229
|
-
/** @deprecated Use {@link CreateUserOption}. Removed in 0.3.0. */
|
|
230
|
-
export type UserOptionBuilder = CreateUserOption;
|
|
231
|
-
/** @deprecated Use {@link ApplicationCommandOptionEnum}. Removed in 0.3.0. */
|
|
232
|
-
export declare const ApplicationCommandOptionType: {
|
|
233
|
-
readonly Subcommand: 1;
|
|
234
|
-
readonly SubcommandGroup: 2;
|
|
235
|
-
readonly String: 3;
|
|
236
|
-
readonly Integer: 4;
|
|
237
|
-
readonly Boolean: 5;
|
|
238
|
-
readonly User: 6;
|
|
239
|
-
readonly Channel: 7;
|
|
240
|
-
readonly Role: 8;
|
|
241
|
-
readonly Mentionable: 9;
|
|
242
|
-
readonly Number: 10;
|
|
243
|
-
readonly Attachment: 11;
|
|
244
|
-
};
|
|
245
|
-
/** @deprecated Use {@link ApplicationCommandOptionEnum}. Removed in 0.3.0. */
|
|
246
|
-
export type ApplicationCommandOptionType = ApplicationCommandOptionEnum;
|
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
import { ButtonType } from "@lunibee/types";
|
|
2
|
-
export { ButtonType };
|
|
3
|
-
/** Component type constants exposed by Lunibee. */
|
|
4
|
-
export declare const ComponentEnum: {
|
|
5
|
-
readonly ActionRow: 1;
|
|
6
|
-
readonly Button: 2;
|
|
7
|
-
readonly StringSelect: 3;
|
|
8
|
-
readonly TextInput: 4;
|
|
9
|
-
readonly UserSelect: 5;
|
|
10
|
-
readonly RoleSelect: 6;
|
|
11
|
-
readonly MentionableSelect: 7;
|
|
12
|
-
readonly ChannelSelect: 8;
|
|
13
|
-
readonly Section: 9;
|
|
14
|
-
readonly TextDisplay: 10;
|
|
15
|
-
readonly Thumbnail: 11;
|
|
16
|
-
readonly MediaGallery: 12;
|
|
17
|
-
readonly File: 13;
|
|
18
|
-
readonly Separator: 14;
|
|
19
|
-
readonly ContentInventoryEntry: 16;
|
|
20
|
-
readonly Container: 17;
|
|
21
|
-
};
|
|
1
|
+
import { ButtonType, ComponentEnum } from "@lunibee/types";
|
|
2
|
+
export { ButtonType, ComponentEnum };
|
|
22
3
|
export declare const TextInputType: {
|
|
23
4
|
readonly Short: 1;
|
|
24
5
|
readonly Paragraph: 2;
|
|
25
6
|
};
|
|
26
7
|
/** One {@link TextInputType} value, usable as a type. */
|
|
27
8
|
export type TextInputType = (typeof TextInputType)[keyof typeof TextInputType];
|
|
28
|
-
/** One {@link ComponentEnum} value, usable as a type. */
|
|
29
|
-
export type ComponentEnum = (typeof ComponentEnum)[keyof typeof ComponentEnum];
|
|
30
9
|
export interface APIComponentEmoji {
|
|
31
10
|
id?: string | null;
|
|
32
11
|
name?: string | null;
|
|
@@ -157,14 +136,20 @@ export declare class CreateActionRow<T extends {
|
|
|
157
136
|
clearComponents(): this;
|
|
158
137
|
toJSON(): APIActionRowComponent;
|
|
159
138
|
}
|
|
160
|
-
|
|
139
|
+
/** Setters shared by string and entity select menus. */
|
|
140
|
+
export declare class CreateSelectMenu {
|
|
161
141
|
#private;
|
|
142
|
+
protected constructor(data: APIStringSelectComponent | APIEntitySelectComponent);
|
|
162
143
|
setCustomId(value: string): this;
|
|
163
144
|
setPlaceholder(value: string): this;
|
|
164
145
|
setMinValues(value: number): this;
|
|
165
146
|
setMaxValues(value: number): this;
|
|
166
147
|
setRequired(value?: boolean): this;
|
|
167
148
|
setDisabled(value?: boolean): this;
|
|
149
|
+
}
|
|
150
|
+
export declare class CreateStringSelect extends CreateSelectMenu {
|
|
151
|
+
#private;
|
|
152
|
+
constructor();
|
|
168
153
|
addOptions(...options: APISelectOption[]): this;
|
|
169
154
|
toJSON(): APIStringSelectComponent;
|
|
170
155
|
}
|
|
@@ -181,15 +166,9 @@ export declare class CreateButton {
|
|
|
181
166
|
setDisabled(value?: boolean): this;
|
|
182
167
|
toJSON(): APIButtonComponent;
|
|
183
168
|
}
|
|
184
|
-
export declare class CreateEntitySelect {
|
|
169
|
+
export declare class CreateEntitySelect extends CreateSelectMenu {
|
|
185
170
|
#private;
|
|
186
171
|
constructor(type: typeof ComponentEnum.UserSelect | typeof ComponentEnum.RoleSelect | typeof ComponentEnum.MentionableSelect | typeof ComponentEnum.ChannelSelect);
|
|
187
|
-
setCustomId(value: string): this;
|
|
188
|
-
setPlaceholder(value: string): this;
|
|
189
|
-
setMinValues(value: number): this;
|
|
190
|
-
setMaxValues(value: number): this;
|
|
191
|
-
setRequired(value?: boolean): this;
|
|
192
|
-
setDisabled(value?: boolean): this;
|
|
193
172
|
setDefaultValues(...values: APISelectDefaultValue[]): this;
|
|
194
173
|
toJSON(): APIEntitySelectComponent;
|
|
195
174
|
}
|
|
@@ -310,122 +289,3 @@ export declare function componentsV2Message<T extends Record<string, unknown> =
|
|
|
310
289
|
components: APIComponent[];
|
|
311
290
|
flags: number;
|
|
312
291
|
} & T;
|
|
313
|
-
/** @deprecated Use {@link CreateButton}. Removed in 0.3.0. */
|
|
314
|
-
export declare const ButtonBuilder: typeof CreateButton;
|
|
315
|
-
/** @deprecated Use {@link CreateButton}. Removed in 0.3.0. */
|
|
316
|
-
export type ButtonBuilder = CreateButton;
|
|
317
|
-
/** @deprecated Use {@link CreateChannelSelectMenu}. Removed in 0.3.0. */
|
|
318
|
-
export declare const ChannelSelectMenuBuilder: typeof CreateChannelSelectMenu;
|
|
319
|
-
/** @deprecated Use {@link CreateChannelSelectMenu}. Removed in 0.3.0. */
|
|
320
|
-
export type ChannelSelectMenuBuilder = CreateChannelSelectMenu;
|
|
321
|
-
/** @deprecated Use {@link CreateContainer}. Removed in 0.3.0. */
|
|
322
|
-
export declare const ContainerBuilder: typeof CreateContainer;
|
|
323
|
-
/** @deprecated Use {@link CreateContainer}. Removed in 0.3.0. */
|
|
324
|
-
export type ContainerBuilder = CreateContainer;
|
|
325
|
-
/** @deprecated Use {@link CreateContentInventoryEntry}. Removed in 0.3.0. */
|
|
326
|
-
export declare const ContentInventoryEntryBuilder: typeof CreateContentInventoryEntry;
|
|
327
|
-
/** @deprecated Use {@link CreateContentInventoryEntry}. Removed in 0.3.0. */
|
|
328
|
-
export type ContentInventoryEntryBuilder = CreateContentInventoryEntry;
|
|
329
|
-
/** @deprecated Use {@link CreateEntitySelect}. Removed in 0.3.0. */
|
|
330
|
-
export declare const EntitySelectBuilder: typeof CreateEntitySelect;
|
|
331
|
-
/** @deprecated Use {@link CreateEntitySelect}. Removed in 0.3.0. */
|
|
332
|
-
export type EntitySelectBuilder = CreateEntitySelect;
|
|
333
|
-
/** @deprecated Use {@link CreateFileComponent}. Removed in 0.3.0. */
|
|
334
|
-
export declare const FileComponentBuilder: typeof CreateFileComponent;
|
|
335
|
-
/** @deprecated Use {@link CreateFileComponent}. Removed in 0.3.0. */
|
|
336
|
-
export type FileComponentBuilder = CreateFileComponent;
|
|
337
|
-
/** @deprecated Use {@link CreateMediaGallery}. Removed in 0.3.0. */
|
|
338
|
-
export declare const MediaGalleryBuilder: typeof CreateMediaGallery;
|
|
339
|
-
/** @deprecated Use {@link CreateMediaGallery}. Removed in 0.3.0. */
|
|
340
|
-
export type MediaGalleryBuilder = CreateMediaGallery;
|
|
341
|
-
/** @deprecated Use {@link CreateMentionableSelectMenu}. Removed in 0.3.0. */
|
|
342
|
-
export declare const MentionableSelectMenuBuilder: typeof CreateMentionableSelectMenu;
|
|
343
|
-
/** @deprecated Use {@link CreateMentionableSelectMenu}. Removed in 0.3.0. */
|
|
344
|
-
export type MentionableSelectMenuBuilder = CreateMentionableSelectMenu;
|
|
345
|
-
/** @deprecated Use {@link CreateModal}. Removed in 0.3.0. */
|
|
346
|
-
export declare const ModalBuilder: typeof CreateModal;
|
|
347
|
-
/** @deprecated Use {@link CreateModal}. Removed in 0.3.0. */
|
|
348
|
-
export type ModalBuilder = CreateModal;
|
|
349
|
-
/** @deprecated Use {@link CreateRoleSelectMenu}. Removed in 0.3.0. */
|
|
350
|
-
export declare const RoleSelectMenuBuilder: typeof CreateRoleSelectMenu;
|
|
351
|
-
/** @deprecated Use {@link CreateRoleSelectMenu}. Removed in 0.3.0. */
|
|
352
|
-
export type RoleSelectMenuBuilder = CreateRoleSelectMenu;
|
|
353
|
-
/** @deprecated Use {@link CreateSection}. Removed in 0.3.0. */
|
|
354
|
-
export declare const SectionBuilder: typeof CreateSection;
|
|
355
|
-
/** @deprecated Use {@link CreateSection}. Removed in 0.3.0. */
|
|
356
|
-
export type SectionBuilder = CreateSection;
|
|
357
|
-
/** @deprecated Use {@link CreateSeparator}. Removed in 0.3.0. */
|
|
358
|
-
export declare const SeparatorBuilder: typeof CreateSeparator;
|
|
359
|
-
/** @deprecated Use {@link CreateSeparator}. Removed in 0.3.0. */
|
|
360
|
-
export type SeparatorBuilder = CreateSeparator;
|
|
361
|
-
/** @deprecated Use {@link CreateStringSelect}. Removed in 0.3.0. */
|
|
362
|
-
export declare const StringSelectBuilder: typeof CreateStringSelect;
|
|
363
|
-
/** @deprecated Use {@link CreateStringSelect}. Removed in 0.3.0. */
|
|
364
|
-
export type StringSelectBuilder = CreateStringSelect;
|
|
365
|
-
/** @deprecated Use {@link CreateStringSelectMenu}. Removed in 0.3.0. */
|
|
366
|
-
export declare const StringSelectMenuBuilder: typeof CreateStringSelect;
|
|
367
|
-
/** @deprecated Use {@link CreateStringSelectMenu}. Removed in 0.3.0. */
|
|
368
|
-
export type StringSelectMenuBuilder = CreateStringSelect;
|
|
369
|
-
/** @deprecated Use {@link CreateTextDisplay}. Removed in 0.3.0. */
|
|
370
|
-
export declare const TextDisplayBuilder: typeof CreateTextDisplay;
|
|
371
|
-
/** @deprecated Use {@link CreateTextDisplay}. Removed in 0.3.0. */
|
|
372
|
-
export type TextDisplayBuilder = CreateTextDisplay;
|
|
373
|
-
/** @deprecated Use {@link CreateTextInput}. Removed in 0.3.0. */
|
|
374
|
-
export declare const TextInputBuilder: typeof CreateTextInput;
|
|
375
|
-
/** @deprecated Use {@link CreateTextInput}. Removed in 0.3.0. */
|
|
376
|
-
export type TextInputBuilder = CreateTextInput;
|
|
377
|
-
/** @deprecated Use {@link CreateThumbnail}. Removed in 0.3.0. */
|
|
378
|
-
export declare const ThumbnailBuilder: typeof CreateThumbnail;
|
|
379
|
-
/** @deprecated Use {@link CreateThumbnail}. Removed in 0.3.0. */
|
|
380
|
-
export type ThumbnailBuilder = CreateThumbnail;
|
|
381
|
-
/** @deprecated Use {@link CreateUserSelectMenu}. Removed in 0.3.0. */
|
|
382
|
-
export declare const UserSelectMenuBuilder: typeof CreateUserSelectMenu;
|
|
383
|
-
/** @deprecated Use {@link CreateUserSelectMenu}. Removed in 0.3.0. */
|
|
384
|
-
export type UserSelectMenuBuilder = CreateUserSelectMenu;
|
|
385
|
-
/** @deprecated Use {@link CreateActionRow}. Removed in 0.3.0. */
|
|
386
|
-
export declare const ActionRowBuilder: typeof CreateActionRow;
|
|
387
|
-
/** @deprecated Use {@link CreateActionRow}. Removed in 0.3.0. */
|
|
388
|
-
export type ActionRowBuilder<T extends {
|
|
389
|
-
toJSON(): APIActionRowChild;
|
|
390
|
-
} = {
|
|
391
|
-
toJSON(): APIActionRowChild;
|
|
392
|
-
}> = CreateActionRow<T>;
|
|
393
|
-
/** @deprecated Use {@link ButtonType}. Removed in 0.3.0. */
|
|
394
|
-
export declare const ButtonStyle: {
|
|
395
|
-
readonly Primary: 1;
|
|
396
|
-
readonly Secondary: 2;
|
|
397
|
-
readonly Success: 3;
|
|
398
|
-
readonly Danger: 4;
|
|
399
|
-
readonly Link: 5;
|
|
400
|
-
readonly Premium: 6;
|
|
401
|
-
};
|
|
402
|
-
/** @deprecated Use {@link ButtonType}. Removed in 0.3.0. */
|
|
403
|
-
export type ButtonStyle = ButtonType;
|
|
404
|
-
/** @deprecated Use {@link TextInputType}. Removed in 0.3.0. */
|
|
405
|
-
export declare const TextInputStyle: {
|
|
406
|
-
readonly Short: 1;
|
|
407
|
-
readonly Paragraph: 2;
|
|
408
|
-
};
|
|
409
|
-
/** @deprecated Use {@link TextInputType}. Removed in 0.3.0. */
|
|
410
|
-
export type TextInputStyle = TextInputType;
|
|
411
|
-
/** @deprecated Use {@link ComponentEnum}. Removed in 0.3.0. */
|
|
412
|
-
export declare const ComponentType: {
|
|
413
|
-
readonly ActionRow: 1;
|
|
414
|
-
readonly Button: 2;
|
|
415
|
-
readonly StringSelect: 3;
|
|
416
|
-
readonly TextInput: 4;
|
|
417
|
-
readonly UserSelect: 5;
|
|
418
|
-
readonly RoleSelect: 6;
|
|
419
|
-
readonly MentionableSelect: 7;
|
|
420
|
-
readonly ChannelSelect: 8;
|
|
421
|
-
readonly Section: 9;
|
|
422
|
-
readonly TextDisplay: 10;
|
|
423
|
-
readonly Thumbnail: 11;
|
|
424
|
-
readonly MediaGallery: 12;
|
|
425
|
-
readonly File: 13;
|
|
426
|
-
readonly Separator: 14;
|
|
427
|
-
readonly ContentInventoryEntry: 16;
|
|
428
|
-
readonly Container: 17;
|
|
429
|
-
};
|
|
430
|
-
/** @deprecated Use {@link ComponentEnum}. Removed in 0.3.0. */
|
|
431
|
-
export type ComponentType = ComponentEnum;
|