lunibee 0.2.3 → 0.2.4
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/LICENSE +21 -21
- package/README.md +225 -225
- package/dist/builders/attachment.d.ts +8 -0
- package/dist/builders/commands.d.ts +122 -65
- package/dist/builders/components.d.ts +10 -31
- package/dist/builders/embed.d.ts +66 -33
- package/dist/builders/index.js +97 -131
- package/dist/builders/index.js.map +8 -8
- package/dist/collection/cache.d.ts +13 -6
- package/dist/collection/index.d.ts +90 -17
- package/dist/collection/index.js +442 -266
- package/dist/collection/index.js.map +4 -4
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.js +607 -352
- package/dist/core/index.js.map +47 -47
- package/dist/core/permissions.d.ts +7 -3
- 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.js +769 -587
- package/dist/index.js.map +65 -65
- package/dist/managers/base.d.ts +22 -14
- package/dist/managers/index.d.ts +2 -1
- package/dist/managers/index.js +445 -276
- package/dist/managers/index.js.map +26 -26
- package/dist/managers/message.d.ts +7 -3
- package/dist/rest/errors.d.ts +14 -7
- package/dist/rest/index.d.ts +24 -12
- package/dist/rest/index.js +54 -17
- package/dist/rest/index.js.map +14 -14
- package/dist/rest/redis.d.ts +1 -1
- package/dist/rest/route.d.ts +8 -4
- package/dist/rest/routes.d.ts +102 -48
- package/dist/rest/transport.d.ts +10 -5
- package/dist/rest/webhook.d.ts +9 -5
- package/dist/sharding/bus.d.ts +34 -17
- package/dist/sharding/index.d.ts +34 -17
- package/dist/sharding/index.js +64 -32
- package/dist/sharding/index.js.map +17 -17
- package/dist/structures/base.d.ts +19 -10
- package/dist/structures/channels.d.ts +28 -14
- package/dist/structures/index.js +9 -59
- package/dist/structures/index.js.map +19 -18
- package/dist/structures/interactions.d.ts +96 -48
- package/dist/structures/resources.d.ts +88 -44
- package/dist/types/gateway.d.ts +1 -1
- package/dist/types/index.js +20 -22
- package/dist/types/index.js.map +4 -4
- package/dist/utils/index.js.map +2 -2
- 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/index.d.ts +25 -13
- package/dist/ws/index.js +63 -31
- package/dist/ws/index.js.map +14 -14
- package/dist/ws/protocol.d.ts +10 -2
- package/dist/ws/session.d.ts +14 -4
- package/dist/ws/state.d.ts +22 -11
- package/package.json +15 -14
|
@@ -17,8 +17,10 @@ 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
26
|
/** @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. */
|
|
@@ -27,99 +29,154 @@ export declare class CreateSlashCommand {
|
|
|
27
29
|
setNSFW(nsfw?: boolean): this;
|
|
28
30
|
/** Sets whether the command is NSFW. */
|
|
29
31
|
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
|
|
32
|
+
/** Sets command default member permissions. */
|
|
33
|
+
setDefaultMemberPermissions(permissions: bigint | number | string | null): this;
|
|
34
|
+
/** Sets command integration types. */
|
|
35
|
+
setIntegrationTypes(...types: number[]): this;
|
|
36
|
+
/** Adds a string option. */
|
|
37
|
+
addStringOption(configure: (option: CreateStringOption) => CreateStringOption): this;
|
|
38
|
+
/** Adds an integer option. */
|
|
39
|
+
addIntegerOption(configure: (option: CreateIntegerOption) => CreateIntegerOption): this;
|
|
40
|
+
/** Adds a number option. */
|
|
41
|
+
addNumberOption(configure: (option: CreateNumberOption) => CreateNumberOption): this;
|
|
42
|
+
/** Adds a boolean option. */
|
|
43
|
+
addBooleanOption(configure: (option: CreateBooleanOption) => CreateBooleanOption): this;
|
|
44
|
+
/** Adds a user option. */
|
|
45
|
+
addUserOption(configure: (option: CreateUserOption) => CreateUserOption): this;
|
|
46
|
+
/** Adds a channel option. */
|
|
47
|
+
addChannelOption(configure: (option: CreateChannelOption) => CreateChannelOption): this;
|
|
48
|
+
/** Adds a role option. */
|
|
49
|
+
addRoleOption(configure: (option: CreateRoleOption) => CreateRoleOption): this;
|
|
50
|
+
/** Adds a mentionable option. */
|
|
51
|
+
addMentionableOption(configure: (option: CreateMentionableOption) => CreateMentionableOption): this;
|
|
52
|
+
/** Adds an attachment option. */
|
|
53
|
+
addAttachmentOption(configure: (option: CreateAttachmentOption) => CreateAttachmentOption): this;
|
|
54
|
+
/** Adds a subcommand. */
|
|
55
|
+
addSubcommand(configure: (option: CreateSubcommand) => CreateSubcommand): this;
|
|
56
|
+
/** Adds a subcommand group. */
|
|
57
|
+
addSubcommandGroup(configure: (option: CreateSubcommandGroup) => CreateSubcommandGroup): this;
|
|
58
|
+
/** Serializes the command payload. */
|
|
59
|
+
toJSON(): Record<string, unknown>;
|
|
60
|
+
/** Adds a validated top-level command option. */
|
|
61
|
+
protected addOption(option: CreateCommandOption): this;
|
|
45
62
|
}
|
|
46
63
|
/** Base builder for command options. */
|
|
47
64
|
export declare class CreateCommandOption {
|
|
48
65
|
protected readonly data: Record<string, unknown>;
|
|
49
|
-
/** Creates an option builder. */
|
|
50
|
-
|
|
51
|
-
/** Sets the option
|
|
52
|
-
|
|
53
|
-
/** Sets
|
|
54
|
-
|
|
66
|
+
/** Creates an option builder. */
|
|
67
|
+
constructor(type: number);
|
|
68
|
+
/** Sets the option name. */
|
|
69
|
+
setName(name: string): this;
|
|
70
|
+
/** Sets the option description. */
|
|
71
|
+
setDescription(description: string): this;
|
|
72
|
+
/** Makes the option required or optional. */
|
|
73
|
+
setRequired(required?: boolean): this;
|
|
74
|
+
/** Sets autocomplete. */
|
|
75
|
+
setAutocomplete(enabled?: boolean): this;
|
|
76
|
+
/** Serializes the option payload. */
|
|
77
|
+
toJSON(): Record<string, unknown>;
|
|
55
78
|
}
|
|
56
79
|
/** Builds a string command option. */
|
|
57
80
|
export declare class CreateStringOption extends CreateCommandOption {
|
|
58
|
-
/** Creates a string option. */
|
|
59
|
-
|
|
81
|
+
/** Creates a string option. */
|
|
82
|
+
constructor();
|
|
83
|
+
/** Adds string choices. */
|
|
84
|
+
addChoices(...choices: Array<{
|
|
60
85
|
name: string;
|
|
61
86
|
value: string;
|
|
62
87
|
}>): this;
|
|
63
|
-
/** Sets the minimum string length. */
|
|
64
|
-
|
|
88
|
+
/** Sets the minimum string length. */
|
|
89
|
+
setMinLength(value: number): this;
|
|
90
|
+
/** Sets the maximum string length. */
|
|
91
|
+
setMaxLength(value: number): this;
|
|
65
92
|
}
|
|
66
|
-
/**
|
|
67
|
-
export declare class
|
|
68
|
-
|
|
93
|
+
/** Shared bounds, choices and autocomplete rules of integer and number options. */
|
|
94
|
+
export declare class CreateNumericOption extends CreateCommandOption {
|
|
95
|
+
#private;
|
|
96
|
+
/** Creates a numeric option; `integer` rejects fractional bounds. */
|
|
97
|
+
constructor(type: number, integer: boolean);
|
|
98
|
+
/** Sets the minimum value. */
|
|
69
99
|
setMinValue(value: number): this;
|
|
100
|
+
/** Sets the maximum value; it cannot be below the minimum. */
|
|
70
101
|
setMaxValue(value: number): this;
|
|
102
|
+
/** Enables autocomplete; options with choices cannot use it. */
|
|
71
103
|
setAutocomplete(enabled?: boolean): this;
|
|
104
|
+
/** Adds fixed choices. */
|
|
72
105
|
addChoices(...choices: {
|
|
73
106
|
name: string;
|
|
74
107
|
value: number;
|
|
75
108
|
}[]): this;
|
|
76
109
|
}
|
|
110
|
+
/** Builds an integer command option. */
|
|
111
|
+
export declare class CreateIntegerOption extends CreateNumericOption {
|
|
112
|
+
constructor();
|
|
113
|
+
}
|
|
77
114
|
/** Builds a number command option. */
|
|
78
|
-
export declare class CreateNumberOption extends
|
|
115
|
+
export declare class CreateNumberOption extends CreateNumericOption {
|
|
79
116
|
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
117
|
}
|
|
88
|
-
/** Builds a boolean command option. */
|
|
89
|
-
|
|
118
|
+
/** Builds a boolean command option. */
|
|
119
|
+
export declare class CreateBooleanOption extends CreateCommandOption {
|
|
120
|
+
/** Creates a boolean option. */
|
|
121
|
+
constructor();
|
|
90
122
|
}
|
|
91
|
-
/** Builds a user command option. */
|
|
92
|
-
|
|
123
|
+
/** Builds a user command option. */
|
|
124
|
+
export declare class CreateUserOption extends CreateCommandOption {
|
|
125
|
+
/** Creates a user option. */
|
|
126
|
+
constructor();
|
|
93
127
|
}
|
|
94
|
-
/** Builds a role command option. */
|
|
95
|
-
|
|
128
|
+
/** Builds a role command option. */
|
|
129
|
+
export declare class CreateRoleOption extends CreateCommandOption {
|
|
130
|
+
/** Creates a role option. */
|
|
131
|
+
constructor();
|
|
96
132
|
}
|
|
97
|
-
/** Builds a mentionable command option. */
|
|
98
|
-
|
|
133
|
+
/** Builds a mentionable command option. */
|
|
134
|
+
export declare class CreateMentionableOption extends CreateCommandOption {
|
|
135
|
+
/** Creates a mentionable option. */
|
|
136
|
+
constructor();
|
|
99
137
|
}
|
|
100
|
-
/** Builds an attachment command option. */
|
|
101
|
-
|
|
138
|
+
/** Builds an attachment command option. */
|
|
139
|
+
export declare class CreateAttachmentOption extends CreateCommandOption {
|
|
140
|
+
/** Creates an attachment option. */
|
|
141
|
+
constructor();
|
|
102
142
|
}
|
|
103
|
-
/** Builds a channel command option. */
|
|
104
|
-
|
|
105
|
-
/**
|
|
143
|
+
/** Builds a channel command option. */
|
|
144
|
+
export declare class CreateChannelOption extends CreateCommandOption {
|
|
145
|
+
/** Creates a channel option. */
|
|
146
|
+
constructor();
|
|
147
|
+
/** Restricts accepted channel types. */
|
|
148
|
+
addChannelTypes(...types: number[]): this;
|
|
106
149
|
}
|
|
107
|
-
/** Builds a nested subcommand. */
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
|
|
111
|
-
/** Adds a
|
|
112
|
-
|
|
113
|
-
/** Adds
|
|
114
|
-
|
|
115
|
-
/** Adds a
|
|
116
|
-
|
|
117
|
-
/** Adds
|
|
150
|
+
/** Builds a nested subcommand. */
|
|
151
|
+
export declare class CreateSubcommand extends CreateCommandOption {
|
|
152
|
+
/** Creates a subcommand. */
|
|
153
|
+
constructor();
|
|
154
|
+
/** Adds a string option to this subcommand. */
|
|
155
|
+
addStringOption(configure: (option: CreateStringOption) => CreateStringOption): this;
|
|
156
|
+
/** Adds an integer option to this subcommand. */
|
|
157
|
+
addIntegerOption(configure: (option: CreateIntegerOption) => CreateIntegerOption): this;
|
|
158
|
+
/** Adds a number option to this subcommand. */
|
|
159
|
+
addNumberOption(configure: (option: CreateNumberOption) => CreateNumberOption): this;
|
|
160
|
+
/** Adds a boolean option to this subcommand. */
|
|
161
|
+
addBooleanOption(configure: (option: CreateBooleanOption) => CreateBooleanOption): this;
|
|
162
|
+
/** Adds a user option to this subcommand. */
|
|
163
|
+
addUserOption(configure: (option: CreateUserOption) => CreateUserOption): this;
|
|
164
|
+
/** Adds a channel option to this subcommand. */
|
|
165
|
+
addChannelOption(configure: (option: CreateChannelOption) => CreateChannelOption): this;
|
|
166
|
+
/** Adds a role option to this subcommand. */
|
|
167
|
+
addRoleOption(configure: (option: CreateRoleOption) => CreateRoleOption): this;
|
|
168
|
+
/** Adds a mentionable option to this subcommand. */
|
|
169
|
+
addMentionableOption(configure: (option: CreateMentionableOption) => CreateMentionableOption): this;
|
|
170
|
+
/** Adds an attachment option to this subcommand. */
|
|
171
|
+
addAttachmentOption(configure: (option: CreateAttachmentOption) => CreateAttachmentOption): this;
|
|
118
172
|
protected addChildOption(option: CreateCommandOption): this;
|
|
119
173
|
}
|
|
120
|
-
/** Builds a nested subcommand group. */
|
|
121
|
-
|
|
122
|
-
/**
|
|
174
|
+
/** Builds a nested subcommand group. */
|
|
175
|
+
export declare class CreateSubcommandGroup extends CreateCommandOption {
|
|
176
|
+
/** Creates a subcommand group. */
|
|
177
|
+
constructor();
|
|
178
|
+
/** Adds a subcommand to this group. */
|
|
179
|
+
addSubcommand(configure: (option: CreateSubcommand) => CreateSubcommand): this;
|
|
123
180
|
}
|
|
124
181
|
/** Builder for application commands that appear in right-click context menus.
|
|
125
182
|
* Discord.js-familiar: `new CreateContextMenuCommand().setName("x").setType(2)`. */
|
|
@@ -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
|
}
|
package/dist/builders/embed.d.ts
CHANGED
|
@@ -1,62 +1,95 @@
|
|
|
1
1
|
/** Discord API embed field payload. */
|
|
2
2
|
export interface EmbedField {
|
|
3
|
-
/** Field name. */
|
|
4
|
-
|
|
5
|
-
/**
|
|
3
|
+
/** Field name. */
|
|
4
|
+
name: string;
|
|
5
|
+
/** Field value. */
|
|
6
|
+
value: string;
|
|
7
|
+
/** Whether the field is displayed inline. */
|
|
8
|
+
inline?: boolean;
|
|
6
9
|
}
|
|
7
10
|
/** Discord API embed footer payload. */
|
|
8
11
|
export interface EmbedFooter {
|
|
9
|
-
/** Footer text. */
|
|
10
|
-
|
|
12
|
+
/** Footer text. */
|
|
13
|
+
text: string;
|
|
14
|
+
/** Footer icon URL. */
|
|
15
|
+
icon_url?: string;
|
|
11
16
|
}
|
|
12
17
|
/** Discord API embed author payload. */
|
|
13
18
|
export interface EmbedAuthor {
|
|
14
|
-
/** Author display name. */
|
|
15
|
-
|
|
16
|
-
/** Author
|
|
19
|
+
/** Author display name. */
|
|
20
|
+
name: string;
|
|
21
|
+
/** Author URL. */
|
|
22
|
+
url?: string;
|
|
23
|
+
/** Author icon URL. */
|
|
24
|
+
icon_url?: string;
|
|
17
25
|
}
|
|
18
26
|
/** Strict Discord API embed payload. */
|
|
19
27
|
export interface APIEmbed {
|
|
20
|
-
/** Embed title. */
|
|
21
|
-
|
|
22
|
-
/** Embed
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
/** Embed
|
|
27
|
-
|
|
28
|
+
/** Embed title. */
|
|
29
|
+
title?: string;
|
|
30
|
+
/** Embed description. */
|
|
31
|
+
description?: string;
|
|
32
|
+
/** Embed URL. */
|
|
33
|
+
url?: string;
|
|
34
|
+
/** Embed color. */
|
|
35
|
+
color?: number;
|
|
36
|
+
/** ISO-8601 timestamp. */
|
|
37
|
+
timestamp?: string;
|
|
38
|
+
/** Embed footer. */
|
|
39
|
+
footer?: EmbedFooter;
|
|
40
|
+
/** Embed author. */
|
|
41
|
+
author?: EmbedAuthor;
|
|
42
|
+
/** Thumbnail payload. */
|
|
43
|
+
thumbnail?: {
|
|
28
44
|
url: string;
|
|
29
45
|
};
|
|
30
|
-
/** Image payload. */
|
|
46
|
+
/** Image payload. */
|
|
47
|
+
image?: {
|
|
31
48
|
url: string;
|
|
32
49
|
};
|
|
33
|
-
/** Embed fields. */
|
|
50
|
+
/** Embed fields. */
|
|
51
|
+
fields?: EmbedField[];
|
|
34
52
|
}
|
|
35
53
|
/** Builds compile-time-safe rich embed payloads for Discord API requests. */
|
|
36
54
|
export declare class CreateEmbed {
|
|
37
55
|
#private;
|
|
38
|
-
/** Sets the embed title. @param value Title text, or null to clear. @returns This builder. @throws {RangeError} If title exceeds Discord's limit. */
|
|
39
|
-
|
|
40
|
-
/** Sets the embed
|
|
41
|
-
|
|
42
|
-
/** Sets the embed
|
|
43
|
-
|
|
44
|
-
/** Sets the embed
|
|
45
|
-
|
|
56
|
+
/** Sets the embed title. @param value Title text, or null to clear. @returns This builder. @throws {RangeError} If title exceeds Discord's limit. */
|
|
57
|
+
setTitle(value: string | null): this;
|
|
58
|
+
/** Sets the embed description. @param value Description text, or null to clear. @returns This builder. @throws {RangeError} If description exceeds Discord's limit. */
|
|
59
|
+
setDescription(value: string | null): this;
|
|
60
|
+
/** Sets the embed URL. @param value Absolute URL, or null to clear. @returns This builder. @throws {TypeError} If URL is invalid. */
|
|
61
|
+
setURL(value: string | null): this;
|
|
62
|
+
/** Sets the embed color. @param value RGB integer. @returns This builder. @throws {RangeError} If color is outside 24-bit RGB range. */
|
|
63
|
+
setColor(value: number): this;
|
|
64
|
+
/** Sets the embed timestamp. @param value Date value. @returns This builder. @throws {RangeError} If date is invalid. */
|
|
65
|
+
setTimestamp(value?: Date): this;
|
|
66
|
+
/** Sets the embed footer. @param value Footer payload. @returns This builder. @throws {RangeError} If footer text exceeds Discord's limit. */
|
|
67
|
+
setFooter(value: EmbedFooter): this;
|
|
68
|
+
/** Sets the embed author. @param value Author payload. @returns This builder. @throws {RangeError} If author name exceeds Discord's limit. */
|
|
69
|
+
setAuthor(value: EmbedAuthor): this;
|
|
70
|
+
/** Sets the thumbnail URL. @param value Thumbnail URL or payload, or null to clear. @returns This builder. @throws {TypeError} If URL is invalid. */
|
|
71
|
+
setThumbnail(value: {
|
|
46
72
|
url: string;
|
|
47
73
|
} | string | null): this;
|
|
48
|
-
/** Sets the image URL. @param value Image URL or payload, or null to clear. @returns This builder. @throws {TypeError} If URL is invalid. */
|
|
74
|
+
/** Sets the image URL. @param value Image URL or payload, or null to clear. @returns This builder. @throws {TypeError} If URL is invalid. */
|
|
75
|
+
setImage(value: {
|
|
49
76
|
url: string;
|
|
50
77
|
} | string | null): this;
|
|
51
78
|
/** Adds embed fields. Accepts both the spread form `addFields(a, b)` and the
|
|
52
79
|
* single-array form `addFields([a, b])` for discord.js `RestOrArray` parity.
|
|
53
|
-
* @param fields Field payloads, spread or as a single array. @returns This builder. @throws {RangeError} If the 25-field limit is exceeded. */
|
|
80
|
+
* @param fields Field payloads, spread or as a single array. @returns This builder. @throws {RangeError} If the 25-field limit is exceeded. */
|
|
81
|
+
addFields(...fields: EmbedField[] | [EmbedField[]]): this;
|
|
54
82
|
setFields(fields: EmbedField[]): this;
|
|
55
|
-
/** Replaces fields starting at an index. @param index Start index. @param deleteCount Number of fields to remove. @param fields Replacement fields. @returns This builder. @throws {RangeError} If arguments are invalid or the 25-field limit is exceeded. */
|
|
56
|
-
|
|
57
|
-
/** Removes
|
|
58
|
-
|
|
59
|
-
/**
|
|
83
|
+
/** Replaces fields starting at an index. @param index Start index. @param deleteCount Number of fields to remove. @param fields Replacement fields. @returns This builder. @throws {RangeError} If arguments are invalid or the 25-field limit is exceeded. */
|
|
84
|
+
spliceFields(index: number, deleteCount: number, ...fields: EmbedField[]): this;
|
|
85
|
+
/** Removes all embed fields. @returns This builder. */
|
|
86
|
+
clearFields(): this;
|
|
87
|
+
/** Removes the embed title. @returns This builder. */
|
|
88
|
+
clearTitle(): this;
|
|
89
|
+
/** Removes the embed description. @returns This builder. */
|
|
90
|
+
clearDescription(): this;
|
|
91
|
+
/** Returns a deep-cloned Discord API payload. @returns Strict embed payload. */
|
|
92
|
+
get data(): APIEmbed;
|
|
60
93
|
toJSON(): APIEmbed;
|
|
61
94
|
}
|
|
62
95
|
/** @deprecated Use {@link CreateEmbed}. Removed in 0.3.0. */
|